lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
List overview
Plugins-Commits
October 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
plugins-commits@lists.geany.org
1 participants
17 discussions
Start a n
N
ew thread
[geany/geany-plugins] 0bfe89: Merge pull request #916 from eht16/overview_fix_cppcheck
by Frank Lanitz
11 Oct '19
11 Oct '19
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Fri, 11 Oct 2019 06:08:39 UTC Commit: 0bfe89d1a4da1d3781e7465e2ae2db9bcfd06e8e
https://github.com/geany/geany-plugins/commit/0bfe89d1a4da1d3781e7465e2ae2d…
Log Message: ----------- Merge pull request #916 from eht16/overview_fix_cppcheck Overview: initialize color variables Modified Paths: -------------- overview/overview/overviewscintilla.c Modified: overview/overview/overviewscintilla.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -796,14 +796,14 @@ overview_scintilla_get_property (GObject *object, break; case PROP_OVERLAY_COLOR: { - OverviewColor color; + OverviewColor color = { 0 }; overview_scintilla_get_overlay_color (self, &color); g_value_set_boxed (value, &color); break; } case PROP_OVERLAY_OUTLINE_COLOR: { - OverviewColor color; + OverviewColor color = { 0 }; overview_scintilla_get_overlay_outline_color (self, &color); g_value_set_boxed (value, &color); break; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] c68c42: Merge pull request #919 from techee/vimode_b
by Frank Lanitz
11 Oct '19
11 Oct '19
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Fri, 11 Oct 2019 06:07:54 UTC Commit: c68c425ae2578462bc90d653e5fb62b1af7de33e
https://github.com/geany/geany-plugins/commit/c68c425ae2578462bc90d653e5fb6…
Log Message: ----------- Merge pull request #919 from techee/vimode_b vimode: Don't use word navigation from Scintilla Modified Paths: -------------- vimode/src/Makefile.am vimode/src/cmd-runner.c vimode/src/cmds/motion-word.c vimode/src/cmds/motion-word.h vimode/src/cmds/motion.c vimode/src/cmds/motion.h Modified: vimode/src/Makefile.am 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -26,6 +26,8 @@ vi_srcs = \ excmd-prompt.c \ cmds/motion.h \ cmds/motion.c \ + cmds/motion-word.h \ + cmds/motion-word.c \ cmds/txtobjs.h \ cmds/txtobjs.c \ cmds/changemode.h \ Modified: vimode/src/cmd-runner.c 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "utils.h" #include "cmds/motion.h" +#include "cmds/motion-word.h" #include "cmds/txtobjs.h" #include "cmds/changemode.h" #include "cmds/edit.h" Modified: vimode/src/cmds/motion-word.c 266 lines changed, 266 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,266 @@ +/* + * Copyright 2019 Jiri Techet <techet(a)gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "cmds/motion-word.h" + +typedef gboolean (*CharacterPredicate)(gchar c); + + +static void get_current(ScintillaObject *sci, gchar *ch, gint *pos) +{ + *pos = SSM(sci, SCI_GETCURRENTPOS, 0, 0); + *ch = SSM(sci, SCI_GETCHARAT, *pos, 0); +} + + +static void move_left(ScintillaObject *sci, gchar *ch, gint *pos) +{ + *pos = PREV(sci, *pos); + *ch = SSM(sci, SCI_GETCHARAT, *pos, 0); +} + + +static void move_right(ScintillaObject *sci, gchar *ch, gint *pos) +{ + *pos = NEXT(sci, *pos); + *ch = SSM(sci, SCI_GETCHARAT, *pos, 0); +} + + +static gboolean is_wordchar(gchar c) +{ + return g_ascii_isalnum(c) || c == '_' || (c >= 192 && c <= 255); +} + + +static gboolean is_space(gchar c) +{ + return g_ascii_isspace(c); +} + + +static gboolean is_nonspace(gchar c) +{ + return !is_space(c); +} + + +static gboolean is_nonwordchar(gchar c) +{ + return !is_wordchar(c) && !is_space(c); +} + + +static gboolean skip_to_left(CharacterPredicate is_in_group, ScintillaObject *sci, gchar *ch, gint *pos) +{ + gboolean moved = FALSE; + while (is_in_group(*ch) && *pos > 0) + { + move_left(sci, ch, pos); + moved = TRUE; + } + return moved; +} + + +static gboolean skip_to_right(CharacterPredicate is_in_group, ScintillaObject *sci, gchar *ch, gint *pos, gint len) +{ + gboolean moved = FALSE; + while (is_in_group(*ch) && *pos < len) + { + move_right(sci, ch, pos); + moved = TRUE; + } + return moved; +} + + +void cmd_goto_next_word(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + if (!skip_to_right(is_wordchar, p->sci, &ch, &pos, len)) + skip_to_right(is_nonwordchar, p->sci, &ch, &pos, len); + skip_to_right(is_space, p->sci, &ch, &pos, len); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_left(p->sci, &ch, &pos); + + skip_to_left(is_space, p->sci, &ch, &pos); + if (!skip_to_left(is_wordchar, p->sci, &ch, &pos)) + skip_to_left(is_nonwordchar, p->sci, &ch, &pos); + + if (pos != 0 || is_space(ch)) + move_right(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_next_word_end(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_right(p->sci, &ch, &pos); + + skip_to_right(is_space, p->sci, &ch, &pos, len); + if (!skip_to_right(is_wordchar, p->sci, &ch, &pos, len)) + skip_to_right(is_nonwordchar, p->sci, &ch, &pos, len); + + if (pos < len - 1 || is_space(ch)) + move_left(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + if (!skip_to_left(is_wordchar, p->sci, &ch, &pos)) + skip_to_left(is_nonwordchar, p->sci, &ch, &pos); + skip_to_left(is_space, p->sci, &ch, &pos); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_next_word_space(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + skip_to_right(is_nonspace, p->sci, &ch, &pos, len); + skip_to_right(is_space, p->sci, &ch, &pos, len); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_left(p->sci, &ch, &pos); + + skip_to_left(is_space, p->sci, &ch, &pos); + skip_to_left(is_nonspace, p->sci, &ch, &pos); + + if (pos != 0 || is_space(ch)) + move_right(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_right(p->sci, &ch, &pos); + + skip_to_right(is_space, p->sci, &ch, &pos, len); + skip_to_right(is_nonspace, p->sci, &ch, &pos, len); + + if (pos < len - 1 || is_space(ch)) + move_left(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + skip_to_left(is_nonspace, p->sci, &ch, &pos); + skip_to_left(is_space, p->sci, &ch, &pos); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} Modified: vimode/src/cmds/motion-word.h 34 lines changed, 34 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Jiri Techet <techet(a)gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __VIMODE_CMDS_MOTION_WORD_H__ +#define __VIMODE_CMDS_MOTION_WORD_H__ + +#include "context.h" +#include "cmd-params.h" + +void cmd_goto_next_word(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word(CmdContext *c, CmdParams *p); +void cmd_goto_next_word_end(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p); +void cmd_goto_next_word_space(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p); +void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p); + +#endif Modified: vimode/src/cmds/motion.c 138 lines changed, 0 insertions(+), 138 deletions(-) =================================================================== @@ -214,144 +214,6 @@ void cmd_goto_doc_percentage(CmdContext *c, CmdParams *p) } -static void goto_word_end(CmdContext *c, CmdParams *p, gboolean forward) -{ - gint i; - - if (VI_IS_COMMAND(vi_get_mode())) - SSM(p->sci, SCI_CHARRIGHT, 0, 0); - - for (i = 0; i < p->num; i++) - { - gint orig_pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - gint pos; - gint line_start_pos; - - SSM(p->sci, forward ? SCI_WORDRIGHTEND : SCI_WORDLEFTEND, 0, 0); - line_start_pos = SSM(p->sci, SCI_POSITIONFROMLINE, GET_CUR_LINE(p->sci), 0); - pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - if (pos == orig_pos) - break; - /* For some reason, Scintilla treats newlines as word parts and cursor - * is left before/after newline. Repeat again in this case. */ - if (pos == line_start_pos) - SSM(p->sci, forward ? SCI_WORDRIGHTEND : SCI_WORDLEFTEND, 0, 0); - } - - if (VI_IS_COMMAND(vi_get_mode())) - SSM(p->sci, SCI_CHARLEFT, 0, 0); -} - - -static void goto_word_start(CmdContext *c, CmdParams *p, gboolean forward) -{ - gint i; - for (i = 0; i < p->num; i++) - { - gint orig_pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - gint pos; - gint line_end_pos; - - SSM(p->sci, forward ? SCI_WORDRIGHT : SCI_WORDLEFT, 0, 0); - line_end_pos = SSM(p->sci, SCI_GETLINEENDPOSITION, GET_CUR_LINE(p->sci), 0); - pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - if (pos == orig_pos) - break; - /* For some reason, Scintilla treats newlines as word parts and cursor - * is left before/after newline. Repeat again in this case. */ - if (pos == line_end_pos) - SSM(p->sci, forward ? SCI_WORDRIGHT : SCI_WORDLEFT, 0, 0); - } -} - - -void cmd_goto_next_word(CmdContext *c, CmdParams *p) -{ - goto_word_start(c, p, TRUE); -} - - -void cmd_goto_previous_word(CmdContext *c, CmdParams *p) -{ - goto_word_start(c, p, FALSE); -} - - -void cmd_goto_next_word_end(CmdContext *c, CmdParams *p) -{ - goto_word_end(c, p, TRUE); -} - - -void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p) -{ - goto_word_end(c, p, FALSE); -} - - -static void use_all_wordchars(ScintillaObject *sci) -{ - guchar wc[512]; - gint i; - gint j = 0; - for (i = 0; i < 256; i++) - { - if (g_ascii_isprint(i) && !g_ascii_isspace(i)) - wc[j++] = i; - } - wc[j] = '\0'; - SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_next_word_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_start(c, p, TRUE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_start(c, p, FALSE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_end(c, p, TRUE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_end(c, p, FALSE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - void cmd_goto_line_start(CmdContext *c, CmdParams *p) { SSM(p->sci, SCI_HOME, 0, 0); Modified: vimode/src/cmds/motion.h 9 lines changed, 0 insertions(+), 9 deletions(-) =================================================================== @@ -41,15 +41,6 @@ void cmd_goto_screen_middle(CmdContext *c, CmdParams *p); void cmd_goto_screen_bottom(CmdContext *c, CmdParams *p); void cmd_goto_doc_percentage(CmdContext *c, CmdParams *p); -void cmd_goto_next_word(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word(CmdContext *c, CmdParams *p); -void cmd_goto_next_word_end(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p); -void cmd_goto_next_word_space(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p); -void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p); - void cmd_goto_line_start(CmdContext *c, CmdParams *p); void cmd_goto_line_start_nonempty(CmdContext *c, CmdParams *p); void cmd_goto_line_end(CmdContext *c, CmdParams *p); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 12ec21: Merge pull request #925 from muhaaliss/master
by Frank Lanitz
09 Oct '19
09 Oct '19
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Wed, 09 Oct 2019 06:03:32 UTC Commit: 12ec211195702fdbe79b50cf8bdfb07f3df2414b
https://github.com/geany/geany-plugins/commit/12ec211195702fdbe79b50cf8bdfb…
Log Message: ----------- Merge pull request #925 from muhaaliss/master Turkish translations updated Modified Paths: -------------- po/tr.po Modified: po/tr.po 1400 lines changed, 673 insertions(+), 727 deletions(-) =================================================================== No diff available, check online -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 9d2f8b: Turkish translations updated
by Muha Aliss
09 Oct '19
09 Oct '19
Branch: refs/heads/master Author: Muha Aliss <muhaaliss(a)gmail.com> Committer: GitHub <noreply(a)github.com> Date: Wed, 09 Oct 2019 00:28:42 UTC Commit: 9d2f8bb1a6e9d0ceb2b883bc0e364655665957d5
https://github.com/geany/geany-plugins/commit/9d2f8bb1a6e9d0ceb2b883bc0e364…
Log Message: ----------- Turkish translations updated Modified Paths: -------------- po/tr.po Modified: po/tr.po 1400 lines changed, 673 insertions(+), 727 deletions(-) =================================================================== No diff available, check online -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] b77774: vimode: Don't use word navigation from Scintilla
by Jiří Techet
07 Oct '19
07 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Mon, 07 Oct 2019 12:34:19 UTC Commit: b77774eb46833aba061f537cef5ffb5c8b45eaab
https://github.com/geany/geany-plugins/commit/b77774eb46833aba061f537cef5ff…
Log Message: ----------- vimode: Don't use word navigation from Scintilla Scintilla does different things when using SCI_WORDRIGHT, SCI_WORDLEFT, SCI_WORDRIGHTEND and SCI_WORDLEFTEND than what we want for commands like "w", "b", "W", "B", "e", "E", "ge", "gE". For instance, for ident1 = id|ent2+ident3; where | represents the cursor, SCI_WORDRIGHT does ident1 = ident2+|ident3; while Vim's "w" does ident1 = ident2|+ident3; For this reason we have to reimplement all the word navigation by ourselves to better emulate the behavior of Vim. This patch tries to do that. Modified Paths: -------------- vimode/src/Makefile.am vimode/src/cmd-runner.c vimode/src/cmds/motion-word.c vimode/src/cmds/motion-word.h vimode/src/cmds/motion.c vimode/src/cmds/motion.h Modified: vimode/src/Makefile.am 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -26,6 +26,8 @@ vi_srcs = \ excmd-prompt.c \ cmds/motion.h \ cmds/motion.c \ + cmds/motion-word.h \ + cmds/motion-word.c \ cmds/txtobjs.h \ cmds/txtobjs.c \ cmds/changemode.h \ Modified: vimode/src/cmd-runner.c 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "utils.h" #include "cmds/motion.h" +#include "cmds/motion-word.h" #include "cmds/txtobjs.h" #include "cmds/changemode.h" #include "cmds/edit.h" Modified: vimode/src/cmds/motion-word.c 266 lines changed, 266 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,266 @@ +/* + * Copyright 2019 Jiri Techet <techet(a)gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "cmds/motion-word.h" + +typedef gboolean (*CharacterPredicate)(gchar c); + + +static void get_current(ScintillaObject *sci, gchar *ch, gint *pos) +{ + *pos = SSM(sci, SCI_GETCURRENTPOS, 0, 0); + *ch = SSM(sci, SCI_GETCHARAT, *pos, 0); +} + + +static void move_left(ScintillaObject *sci, gchar *ch, gint *pos) +{ + *pos = PREV(sci, *pos); + *ch = SSM(sci, SCI_GETCHARAT, *pos, 0); +} + + +static void move_right(ScintillaObject *sci, gchar *ch, gint *pos) +{ + *pos = NEXT(sci, *pos); + *ch = SSM(sci, SCI_GETCHARAT, *pos, 0); +} + + +static gboolean is_wordchar(gchar c) +{ + return g_ascii_isalnum(c) || c == '_' || (c >= 192 && c <= 255); +} + + +static gboolean is_space(gchar c) +{ + return g_ascii_isspace(c); +} + + +static gboolean is_nonspace(gchar c) +{ + return !is_space(c); +} + + +static gboolean is_nonwordchar(gchar c) +{ + return !is_wordchar(c) && !is_space(c); +} + + +static gboolean skip_to_left(CharacterPredicate is_in_group, ScintillaObject *sci, gchar *ch, gint *pos) +{ + gboolean moved = FALSE; + while (is_in_group(*ch) && *pos > 0) + { + move_left(sci, ch, pos); + moved = TRUE; + } + return moved; +} + + +static gboolean skip_to_right(CharacterPredicate is_in_group, ScintillaObject *sci, gchar *ch, gint *pos, gint len) +{ + gboolean moved = FALSE; + while (is_in_group(*ch) && *pos < len) + { + move_right(sci, ch, pos); + moved = TRUE; + } + return moved; +} + + +void cmd_goto_next_word(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + if (!skip_to_right(is_wordchar, p->sci, &ch, &pos, len)) + skip_to_right(is_nonwordchar, p->sci, &ch, &pos, len); + skip_to_right(is_space, p->sci, &ch, &pos, len); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_left(p->sci, &ch, &pos); + + skip_to_left(is_space, p->sci, &ch, &pos); + if (!skip_to_left(is_wordchar, p->sci, &ch, &pos)) + skip_to_left(is_nonwordchar, p->sci, &ch, &pos); + + if (pos != 0 || is_space(ch)) + move_right(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_next_word_end(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_right(p->sci, &ch, &pos); + + skip_to_right(is_space, p->sci, &ch, &pos, len); + if (!skip_to_right(is_wordchar, p->sci, &ch, &pos, len)) + skip_to_right(is_nonwordchar, p->sci, &ch, &pos, len); + + if (pos < len - 1 || is_space(ch)) + move_left(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + if (!skip_to_left(is_wordchar, p->sci, &ch, &pos)) + skip_to_left(is_nonwordchar, p->sci, &ch, &pos); + skip_to_left(is_space, p->sci, &ch, &pos); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_next_word_space(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + skip_to_right(is_nonspace, p->sci, &ch, &pos, len); + skip_to_right(is_space, p->sci, &ch, &pos, len); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_left(p->sci, &ch, &pos); + + skip_to_left(is_space, p->sci, &ch, &pos); + skip_to_left(is_nonspace, p->sci, &ch, &pos); + + if (pos != 0 || is_space(ch)) + move_right(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p) +{ + gint i; + gint len = SSM(p->sci, SCI_GETLENGTH, 0, 0); + + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + move_right(p->sci, &ch, &pos); + + skip_to_right(is_space, p->sci, &ch, &pos, len); + skip_to_right(is_nonspace, p->sci, &ch, &pos, len); + + if (pos < len - 1 || is_space(ch)) + move_left(p->sci, &ch, &pos); + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} + + +void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p) +{ + gint i; + for (i = 0; i < p->num; i++) + { + gint pos; + gchar ch; + + get_current(p->sci, &ch, &pos); + + skip_to_left(is_nonspace, p->sci, &ch, &pos); + skip_to_left(is_space, p->sci, &ch, &pos); + + if (!is_space(ch)) + SET_POS(p->sci, pos, TRUE); + } +} Modified: vimode/src/cmds/motion-word.h 34 lines changed, 34 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Jiri Techet <techet(a)gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __VIMODE_CMDS_MOTION_WORD_H__ +#define __VIMODE_CMDS_MOTION_WORD_H__ + +#include "context.h" +#include "cmd-params.h" + +void cmd_goto_next_word(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word(CmdContext *c, CmdParams *p); +void cmd_goto_next_word_end(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p); +void cmd_goto_next_word_space(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p); +void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p); +void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p); + +#endif Modified: vimode/src/cmds/motion.c 138 lines changed, 0 insertions(+), 138 deletions(-) =================================================================== @@ -214,144 +214,6 @@ void cmd_goto_doc_percentage(CmdContext *c, CmdParams *p) } -static void goto_word_end(CmdContext *c, CmdParams *p, gboolean forward) -{ - gint i; - - if (VI_IS_COMMAND(vi_get_mode())) - SSM(p->sci, SCI_CHARRIGHT, 0, 0); - - for (i = 0; i < p->num; i++) - { - gint orig_pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - gint pos; - gint line_start_pos; - - SSM(p->sci, forward ? SCI_WORDRIGHTEND : SCI_WORDLEFTEND, 0, 0); - line_start_pos = SSM(p->sci, SCI_POSITIONFROMLINE, GET_CUR_LINE(p->sci), 0); - pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - if (pos == orig_pos) - break; - /* For some reason, Scintilla treats newlines as word parts and cursor - * is left before/after newline. Repeat again in this case. */ - if (pos == line_start_pos) - SSM(p->sci, forward ? SCI_WORDRIGHTEND : SCI_WORDLEFTEND, 0, 0); - } - - if (VI_IS_COMMAND(vi_get_mode())) - SSM(p->sci, SCI_CHARLEFT, 0, 0); -} - - -static void goto_word_start(CmdContext *c, CmdParams *p, gboolean forward) -{ - gint i; - for (i = 0; i < p->num; i++) - { - gint orig_pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - gint pos; - gint line_end_pos; - - SSM(p->sci, forward ? SCI_WORDRIGHT : SCI_WORDLEFT, 0, 0); - line_end_pos = SSM(p->sci, SCI_GETLINEENDPOSITION, GET_CUR_LINE(p->sci), 0); - pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - if (pos == orig_pos) - break; - /* For some reason, Scintilla treats newlines as word parts and cursor - * is left before/after newline. Repeat again in this case. */ - if (pos == line_end_pos) - SSM(p->sci, forward ? SCI_WORDRIGHT : SCI_WORDLEFT, 0, 0); - } -} - - -void cmd_goto_next_word(CmdContext *c, CmdParams *p) -{ - goto_word_start(c, p, TRUE); -} - - -void cmd_goto_previous_word(CmdContext *c, CmdParams *p) -{ - goto_word_start(c, p, FALSE); -} - - -void cmd_goto_next_word_end(CmdContext *c, CmdParams *p) -{ - goto_word_end(c, p, TRUE); -} - - -void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p) -{ - goto_word_end(c, p, FALSE); -} - - -static void use_all_wordchars(ScintillaObject *sci) -{ - guchar wc[512]; - gint i; - gint j = 0; - for (i = 0; i < 256; i++) - { - if (g_ascii_isprint(i) && !g_ascii_isspace(i)) - wc[j++] = i; - } - wc[j] = '\0'; - SSM(sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_next_word_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_start(c, p, TRUE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_start(c, p, FALSE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_end(c, p, TRUE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - -void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p) -{ - guchar wc[512]; - SSM(p->sci, SCI_GETWORDCHARS, 0, (sptr_t)wc); - use_all_wordchars(p->sci); - - goto_word_end(c, p, FALSE); - - SSM(p->sci, SCI_SETWORDCHARS, 0, (sptr_t)wc); -} - - void cmd_goto_line_start(CmdContext *c, CmdParams *p) { SSM(p->sci, SCI_HOME, 0, 0); Modified: vimode/src/cmds/motion.h 9 lines changed, 0 insertions(+), 9 deletions(-) =================================================================== @@ -41,15 +41,6 @@ void cmd_goto_screen_middle(CmdContext *c, CmdParams *p); void cmd_goto_screen_bottom(CmdContext *c, CmdParams *p); void cmd_goto_doc_percentage(CmdContext *c, CmdParams *p); -void cmd_goto_next_word(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word(CmdContext *c, CmdParams *p); -void cmd_goto_next_word_end(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word_end(CmdContext *c, CmdParams *p); -void cmd_goto_next_word_space(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word_space(CmdContext *c, CmdParams *p); -void cmd_goto_next_word_end_space(CmdContext *c, CmdParams *p); -void cmd_goto_previous_word_end_space(CmdContext *c, CmdParams *p); - void cmd_goto_line_start(CmdContext *c, CmdParams *p); void cmd_goto_line_start_nonempty(CmdContext *c, CmdParams *p); void cmd_goto_line_end(CmdContext *c, CmdParams *p); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] c15664: Merge pull request #920 from techee/focus_sidebar
by Frank Lanitz
06 Oct '19
06 Oct '19
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Sun, 06 Oct 2019 08:33:29 UTC Commit: c156641259643ef4e32d067dd0b346e558a1a973
https://github.com/geany/geany-plugins/commit/c156641259643ef4e32d067dd0b34…
Log Message: ----------- Merge pull request #920 from techee/focus_sidebar projectorganizer: Add a keybinding for for focusing the sidebar Modified Paths: -------------- projectorganizer/src/prjorg-menu.c projectorganizer/src/prjorg-sidebar.c projectorganizer/src/prjorg-sidebar.h Modified: projectorganizer/src/prjorg-menu.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -42,6 +42,7 @@ enum KB_FIND_IN_PROJECT, KB_FIND_FILE, KB_FIND_TAG, + KB_FOCUS_SIDEBAR, KB_COUNT }; @@ -417,6 +418,9 @@ void prjorg_menu_init(void) keybindings_set_item(key_group, KB_SWAP_HEADER_SOURCE, NULL, 0, 0, "swap_header_source", _("Swap header/source"), s_shs_item); + keybindings_set_item(key_group, KB_FOCUS_SIDEBAR, (GeanyKeyCallback)prjorg_sidebar_focus_project_tab, + 0, 0, "focus_project_sidebar", _("Focus Project Sidebar"), NULL); + s_context_sep_item = gtk_separator_menu_item_new(); gtk_widget_show(s_context_sep_item); gtk_menu_shell_prepend(GTK_MENU_SHELL(geany->main_widgets->editor_menu), s_context_sep_item); Modified: projectorganizer/src/prjorg-sidebar.c 19 lines changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -1493,6 +1493,25 @@ void prjorg_sidebar_find_tag_in_active(void) } +void prjorg_sidebar_focus_project_tab(void) +{ + GtkNotebook *notebook = GTK_NOTEBOOK(geany_data->main_widgets->sidebar_notebook); + gint pagenum = gtk_notebook_get_n_pages(notebook); + gint i; + + for (i = 0; i < pagenum; i++) + { + GtkWidget *page = gtk_notebook_get_nth_page(notebook, i); + if (page == s_file_view_vbox) + { + gtk_notebook_set_current_page(notebook, i); + gtk_widget_grab_focus(s_file_view); + break; + } + } +} + + static void sidebar_realized_cb (GtkWidget *widget) { if (s_pending_reload) prjorg_sidebar_update(TRUE); Modified: projectorganizer/src/prjorg-sidebar.h 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -29,6 +29,7 @@ void prjorg_sidebar_find_tag_in_active(void); void prjorg_sidebar_update(gboolean reload); +void prjorg_sidebar_focus_project_tab(void); #endif -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 14bb5b: Merge pull request #921 from techee/po_reload_fix
by Frank Lanitz
06 Oct '19
06 Oct '19
Branch: refs/heads/master Author: Frank Lanitz <frank(a)frank.uvena.de> Committer: GitHub <noreply(a)github.com> Date: Sun, 06 Oct 2019 08:31:02 UTC Commit: 14bb5bbc5ba446211a6c5f75698ce85620ff90df
https://github.com/geany/geany-plugins/commit/14bb5bbc5ba446211a6c5f75698ce…
Log Message: ----------- Merge pull request #921 from techee/po_reload_fix projectorganizer: re-read base path when updating project Modified Paths: -------------- projectorganizer/src/prjorg-project.c Modified: projectorganizer/src/prjorg-project.c 27 lines changed, 18 insertions(+), 9 deletions(-) =================================================================== @@ -327,13 +327,24 @@ void prjorg_project_rescan(void) } +static PrjOrgRoot *create_root(const gchar *utf8_base_dir) +{ + PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); + root->base_dir = g_strdup(utf8_base_dir); + root->file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); + return root; +} + + static void update_project( gchar **source_patterns, gchar **header_patterns, gchar **ignored_dirs_patterns, gchar **ignored_file_patterns, PrjOrgTagPrefs generate_tag_prefs) { + gchar *utf8_base_path; + if (prj_org->source_patterns) g_strfreev(prj_org->source_patterns); prj_org->source_patterns = g_strdupv(source_patterns); @@ -352,6 +363,13 @@ static void update_project( prj_org->generate_tag_prefs = generate_tag_prefs; + /* re-read the base path in case it was changed in project settings */ + g_free(prj_org->roots->data); + prj_org->roots = g_slist_delete_link(prj_org->roots, prj_org->roots); + utf8_base_path = get_project_base_path(); + prj_org->roots = g_slist_prepend(prj_org->roots, create_root(utf8_base_path)); + g_free(utf8_base_path); + prjorg_project_rescan(); } @@ -386,15 +404,6 @@ void prjorg_project_save(GKeyFile * key_file) } -static PrjOrgRoot *create_root(const gchar *utf8_base_dir) -{ - PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); - root->base_dir = g_strdup(utf8_base_dir); - root->file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); - return root; -} - - static void close_root(PrjOrgRoot *root, gpointer user_data) { GPtrArray *source_files; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] f1ad8a: projectorganizer: re-read base path when updating project
by Jiří Techet
06 Oct '19
06 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sun, 06 Oct 2019 08:02:20 UTC Commit: f1ad8a3e2b765515ad8c19aa995cab50984cbe04
https://github.com/geany/geany-plugins/commit/f1ad8a3e2b765515ad8c19aa995ca…
Log Message: ----------- projectorganizer: re-read base path when updating project Since the base path can change when the project dialog is open, we must re-read the base path, otherwise it doesn't get updated. Modified Paths: -------------- projectorganizer/src/prjorg-project.c Modified: projectorganizer/src/prjorg-project.c 27 lines changed, 18 insertions(+), 9 deletions(-) =================================================================== @@ -327,13 +327,24 @@ void prjorg_project_rescan(void) } +static PrjOrgRoot *create_root(const gchar *utf8_base_dir) +{ + PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); + root->base_dir = g_strdup(utf8_base_dir); + root->file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); + return root; +} + + static void update_project( gchar **source_patterns, gchar **header_patterns, gchar **ignored_dirs_patterns, gchar **ignored_file_patterns, PrjOrgTagPrefs generate_tag_prefs) { + gchar *utf8_base_path; + if (prj_org->source_patterns) g_strfreev(prj_org->source_patterns); prj_org->source_patterns = g_strdupv(source_patterns); @@ -352,6 +363,13 @@ static void update_project( prj_org->generate_tag_prefs = generate_tag_prefs; + /* re-read the base path in case it was changed in project settings */ + g_free(prj_org->roots->data); + prj_org->roots = g_slist_delete_link(prj_org->roots, prj_org->roots); + utf8_base_path = get_project_base_path(); + prj_org->roots = g_slist_prepend(prj_org->roots, create_root(utf8_base_path)); + g_free(utf8_base_path); + prjorg_project_rescan(); } @@ -386,15 +404,6 @@ void prjorg_project_save(GKeyFile * key_file) } -static PrjOrgRoot *create_root(const gchar *utf8_base_dir) -{ - PrjOrgRoot *root = (PrjOrgRoot *) g_new0(PrjOrgRoot, 1); - root->base_dir = g_strdup(utf8_base_dir); - root->file_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GFreeFunc)tm_source_file_free); - return root; -} - - static void close_root(PrjOrgRoot *root, gpointer user_data) { GPtrArray *source_files; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] 4e7c2e: projectorganizer: Add a keybinding for for focusing the sidebar
by Jiří Techet
05 Oct '19
05 Oct '19
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 05 Oct 2019 16:13:35 UTC Commit: 4e7c2eeab695b5fc3c0e6123800ced1c767f7e85
https://github.com/geany/geany-plugins/commit/4e7c2eeab695b5fc3c0e6123800ce…
Log Message: ----------- projectorganizer: Add a keybinding for for focusing the sidebar Modified Paths: -------------- projectorganizer/src/prjorg-menu.c projectorganizer/src/prjorg-sidebar.c projectorganizer/src/prjorg-sidebar.h Modified: projectorganizer/src/prjorg-menu.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -42,6 +42,7 @@ enum KB_FIND_IN_PROJECT, KB_FIND_FILE, KB_FIND_TAG, + KB_FOCUS_SIDEBAR, KB_COUNT }; @@ -417,6 +418,9 @@ void prjorg_menu_init(void) keybindings_set_item(key_group, KB_SWAP_HEADER_SOURCE, NULL, 0, 0, "swap_header_source", _("Swap header/source"), s_shs_item); + keybindings_set_item(key_group, KB_FOCUS_SIDEBAR, (GeanyKeyCallback)prjorg_sidebar_focus_project_tab, + 0, 0, "focus_project_sidebar", _("Focus Project Sidebar"), NULL); + s_context_sep_item = gtk_separator_menu_item_new(); gtk_widget_show(s_context_sep_item); gtk_menu_shell_prepend(GTK_MENU_SHELL(geany->main_widgets->editor_menu), s_context_sep_item); Modified: projectorganizer/src/prjorg-sidebar.c 19 lines changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -1493,6 +1493,25 @@ void prjorg_sidebar_find_tag_in_active(void) } +void prjorg_sidebar_focus_project_tab(void) +{ + GtkNotebook *notebook = GTK_NOTEBOOK(geany_data->main_widgets->sidebar_notebook); + gint pagenum = gtk_notebook_get_n_pages(notebook); + gint i; + + for (i = 0; i < pagenum; i++) + { + GtkWidget *page = gtk_notebook_get_nth_page(notebook, i); + if (page == s_file_view_vbox) + { + gtk_notebook_set_current_page(notebook, i); + gtk_widget_grab_focus(s_file_view); + break; + } + } +} + + static void sidebar_realized_cb (GtkWidget *widget) { if (s_pending_reload) prjorg_sidebar_update(TRUE); Modified: projectorganizer/src/prjorg-sidebar.h 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -29,6 +29,7 @@ void prjorg_sidebar_find_tag_in_active(void); void prjorg_sidebar_update(gboolean reload); +void prjorg_sidebar_focus_project_tab(void); #endif -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-plugins] fa193e: Merge pull request #906 from ntrel/fix-print
by Nick Treleaven
05 Oct '19
05 Oct '19
Branch: refs/heads/master Author: Nick Treleaven <n(a)trelsoft.com> Committer: GitHub <noreply(a)github.com> Date: Sat, 05 Oct 2019 10:56:35 UTC Commit: fa193e4b38f9781660872b727cf4ce27291ee0b5
https://github.com/geany/geany-plugins/commit/fa193e4b38f9781660872b727cf4c…
Log Message: ----------- Merge pull request #906 from ntrel/fix-print g_print: Add newline now Geany's g_print handler doesn't Modified Paths: -------------- codenav/src/codenavigation.h Modified: codenav/src/codenavigation.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -54,7 +54,7 @@ static void log_debug(const gchar* s, ...) va_end(l); } -#define log_func() g_print("[CODENAV FUNC] : %s", G_STRFUNC) +#define log_func() g_print("[CODENAV FUNC] : %s\n", G_STRFUNC) #else #define log_debug(...) {} #define log_func() {} -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
Older →
Jump to page:
1
2
Results per page:
10
25
50
100
200