SF.net SVN: geany:[4885] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sat May 8 13:32:23 UTC 2010


Revision: 4885
          http://geany.svn.sourceforge.net/geany/?rev=4885&view=rev
Author:   eht16
Date:     2010-05-08 13:32:23 +0000 (Sat, 08 May 2010)

Log Message:
-----------
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).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/THANKS
    trunk/src/about.c
    trunk/src/keybindings.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-05-08 13:10:33 UTC (rev 4884)
+++ trunk/ChangeLog	2010-05-08 13:32:23 UTC (rev 4885)
@@ -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  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/THANKS
===================================================================
--- trunk/THANKS	2010-05-08 13:10:33 UTC (rev 4884)
+++ trunk/THANKS	2010-05-08 13:32:23 UTC (rev 4885)
@@ -76,6 +76,7 @@
 Jon Senior <jon(at)restlesslemon(dot)co(dot)uk> - R tagmanager parser patch
 Can Koy <cankoy(at)ymail(dot)com> - Multiple changes/improvements
 Yoann Le Montagner <yoann(dot)le-montagner(at)m4x(dot)org> - set VTE bold color
+Dimitar Zhekov <hamster(at)mbox(dot)contact(dot)bg> - matching brace improvements patch
 
 Translators:
 ------------

Modified: trunk/src/about.c
===================================================================
--- trunk/src/about.c	2010-05-08 13:10:33 UTC (rev 4884)
+++ trunk/src/about.c	2010-05-08 13:32:23 UTC (rev 4885)
@@ -85,7 +85,7 @@
 "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, "

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2010-05-08 13:10:33 UTC (rev 4884)
+++ trunk/src/keybindings.c	2010-05-08 13:32:23 UTC (rev 4885)
@@ -1905,18 +1905,19 @@
 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);
 	}
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list