SF.net SVN: geany:[4016] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Jul 23 16:54:32 UTC 2009


Revision: 4016
          http://geany.svn.sourceforge.net/geany/?rev=4016&view=rev
Author:   ntrel
Date:     2009-07-23 16:54:32 +0000 (Thu, 23 Jul 2009)

Log Message:
-----------
Fix scrolling horizontally after finding a search match with the
search bar or Find Next/Previous which is off-screen.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/document.c
    trunk/src/editor.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-07-23 16:23:28 UTC (rev 4015)
+++ trunk/ChangeLog	2009-07-23 16:54:32 UTC (rev 4016)
@@ -12,6 +12,9 @@
    For the Tabs indent type, remove spaces when unindenting (only) if
    there are no tabs on the line.
    Group undo actions for (un)indenting of multiple lines.
+ * src/document.c, src/editor.c:
+   Fix scrolling horizontally after finding a search match with the
+   search bar or Find Next/Previous which is off-screen.
 
 
 2009-07-21  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2009-07-23 16:23:28 UTC (rev 4015)
+++ trunk/src/document.c	2009-07-23 16:54:32 UTC (rev 4016)
@@ -1852,6 +1852,8 @@
 			 * while searching */
 			editor_scroll_to_line(doc->editor, -1, 0.3F);
 		}
+		else
+			sci_scroll_caret(doc->editor->sci); /* may need horizontal scrolling */
 		return TRUE;
 	}
 	else

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2009-07-23 16:23:28 UTC (rev 4015)
+++ trunk/src/editor.c	2009-07-23 16:54:32 UTC (rev 4016)
@@ -3948,7 +3948,9 @@
 
 /* Note: Usually the line should be made visible (not folded) before calling this.
  * Returns: TRUE if line is/will be displayed to the user, or FALSE if it is
- * outside the view. */
+ * outside the *vertical* view.
+ * Warning: You may need horizontal scrolling to make the cursor visible - so always call
+ * sci_scroll_caret() when this returns TRUE. */
 gboolean editor_line_in_view(GeanyEditor *editor, gint line)
 {
 	gint vis1, los;
@@ -3984,6 +3986,8 @@
 	/* scroll the line if it's off screen */
 	if (! editor_line_in_view(editor, line))
 		editor->scroll_percent = percent_of_view;
+	else
+		sci_scroll_caret(editor->sci); /* may need horizontal scrolling */
 }
 
 


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