diff --git a/ChangeLog b/ChangeLog index 3eb07b15..a066cb30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ style properly (closes #2998347). * src/utils.c: Don't auto-close short XML tags (closes #2994852). + * THANKS, src/about.c, src/keybindings.c: + Improve jumping to matching braces by consistently position the + cursor before or after the matching brace dependent where it + was before (patch by Dimitar Zhekov, thanks). 2010-05-07 Nick Treleaven diff --git a/THANKS b/THANKS index 5de433f4..faf6cdf1 100644 --- a/THANKS +++ b/THANKS @@ -76,6 +76,7 @@ Kelvin Gardiner - VHDL symbol list patch, Verilog filet Jon Senior - R tagmanager parser patch Can Koy - Multiple changes/improvements Yoann Le Montagner - set VTE bold color +Dimitar Zhekov - matching brace improvements patch Translators: ------------ diff --git a/src/about.c b/src/about.c index b197bd10..6f07a621 100644 --- a/src/about.c +++ b/src/about.c @@ -85,7 +85,7 @@ static const gchar *contributors = "Alexander Rodin, Alexey Antipov, Andrew Rowland, Anh Phạm, blackdog, Bo Lorentsen, Bob Doan, " "Bronisław Białek, Can Koy, Catalin Marinas, " "Chris Macksey, Christoph Berg, Colomban Wendling, Conrad Steenberg, Daniel Richard G., Dave Moore, " -"Dirk Weber, Elias Pschernig, Eric Forgeot, Eugene Arshinov, Felipe Pena, François Cami, " +"Dimitar Zhekov, Dirk Weber, Elias Pschernig, Eric Forgeot, Eugene Arshinov, Felipe Pena, François Cami, " "Giuseppe Torelli, Guillaume de Rorthais, Guillaume Hoffmann, Herbert Voss, Jason Oster, " "Jean-François Wauthy, Jeff Pohlmeyer, Jesse Mayes, John Gabriele, Jon Senior, Jon Strait, Josef Whiter, " "Jörn Reder, Kelvin Gardiner, Kevin Ellwood, Kristoffer A. Tjernås, Lex Trotman, Marko Peric, Matti Mårds, " diff --git a/src/keybindings.c b/src/keybindings.c index 1a6f0c76..8347cc16 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -1905,18 +1905,19 @@ static void cb_func_move_tab(guint key_id) static void goto_matching_brace(GeanyDocument *doc) { gint pos, new_pos; + gint after_brace; if (doc == NULL) return; pos = sci_get_current_position(doc->editor->sci); - if (! utils_isbrace(sci_get_char_at(doc->editor->sci, pos), TRUE)) - pos--; /* set pos to the brace */ + after_brace = pos > 0 && utils_isbrace(sci_get_char_at(doc->editor->sci, pos - 1), TRUE); + pos -= after_brace; /* set pos to the brace */ new_pos = sci_find_matching_brace(doc->editor->sci, pos); if (new_pos != -1) - { /* set the cursor at the brace */ - sci_set_current_position(doc->editor->sci, new_pos, FALSE); + { /* set the cursor at/after the brace */ + sci_set_current_position(doc->editor->sci, new_pos + (!after_brace), FALSE); editor_display_current_line(doc->editor, 0.5F); } }