SF.net SVN: geany:[3974] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Jul 16 14:37:43 UTC 2009


Revision: 3974
          http://geany.svn.sourceforge.net/geany/?rev=3974&view=rev
Author:   ntrel
Date:     2009-07-16 14:37:35 +0000 (Thu, 16 Jul 2009)

Log Message:
-----------
Fix wrong match length when using Mark with regex.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/search.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-07-16 12:21:56 UTC (rev 3973)
+++ trunk/ChangeLog	2009-07-16 14:37:35 UTC (rev 3974)
@@ -3,6 +3,8 @@
  * src/search.c:
    Make Mark All keybinding clear search highlighting when there's no
    current word.
+ * src/search.c:
+   Fix wrong match length when using Mark with regex.
 
 
 2009-07-15  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c	2009-07-16 12:21:56 UTC (rev 3973)
+++ trunk/src/search.c	2009-07-16 14:37:35 UTC (rev 3974)
@@ -974,8 +974,6 @@
 	if (!NZV(search_text))
 		return 0;
 
-	len = strlen(search_text);
-
 	ttf.chrg.cpMin = 0;
 	ttf.chrg.cpMax = sci_get_length(doc->editor->sci);
 	ttf.lpstrText = (gchar *)search_text;
@@ -984,7 +982,9 @@
 		pos = sci_find_text(doc->editor->sci, flags, &ttf);
 		if (pos == -1) break;
 
-		editor_indicator_set_on_range(doc->editor, GEANY_INDICATOR_SEARCH, pos, pos + len);
+		len = ttf.chrgText.cpMax - ttf.chrgText.cpMin;
+		if (len)
+			editor_indicator_set_on_range(doc->editor, GEANY_INDICATOR_SEARCH, pos, pos + len);
 
 		ttf.chrg.cpMin = ttf.chrgText.cpMax + 1;
 		count++;


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