SF.net SVN: geany: [2275] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Feb 22 17:30:26 UTC 2008


Revision: 2275
          http://geany.svn.sourceforge.net/geany/?rev=2275&view=rev
Author:   ntrel
Date:     2008-02-22 09:29:45 -0800 (Fri, 22 Feb 2008)

Log Message:
-----------
Don't scroll the editor view if it is unnecessary when using Go to
Marker or Go to Matching Brace commands.
Make sci_set_current_line() not scroll the view, unlike
sci_goto_line().

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/keybindings.c
    trunk/src/sciwrappers.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-02-22 13:30:16 UTC (rev 2274)
+++ trunk/ChangeLog	2008-02-22 17:29:45 UTC (rev 2275)
@@ -7,6 +7,11 @@
    src/editor.h:
    Don't scroll the editor view if it is unnecessary when using Find
    Next/Previous, Find Selected and when searching from the search bar.
+ * src/keybindings.c, src/sciwrappers.c:
+   Don't scroll the editor view if it is unnecessary when using Go to
+   Marker or Go to Matching Brace commands.
+   Make sci_set_current_line() not scroll the view, unlike
+   sci_goto_line().
 
 
 2008-02-22  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2008-02-22 13:30:16 UTC (rev 2274)
+++ trunk/src/keybindings.c	2008-02-22 17:29:45 UTC (rev 2275)
@@ -1135,8 +1135,8 @@
 	new_pos = sci_find_bracematch(doc_list[idx].sci, pos);
 	if (new_pos != -1)
 	{
-		sci_goto_pos(doc_list[idx].sci, new_pos, TRUE); // set the cursor at the brace
-		doc_list[idx].scroll_percent = 0.5F;
+		sci_set_current_position(doc_list[idx].sci, new_pos, FALSE); // set the cursor at the brace
+		editor_display_current_line(idx, 0.5F);
 	}
 }
 
@@ -1187,8 +1187,8 @@
 
 			if (mline != -1)
 			{
-				sci_goto_line(doc_list[idx].sci, mline, TRUE);
-				doc_list[idx].scroll_percent = 0.5F;
+				sci_set_current_line(doc_list[idx].sci, mline);
+				editor_display_current_line(idx, 0.5F);
 			}
 			break;
 		}
@@ -1198,8 +1198,8 @@
 
 			if (mline != -1)
 			{
-				sci_goto_line(doc_list[idx].sci, mline, TRUE);
-				doc_list[idx].scroll_percent = 0.5F;
+				sci_set_current_line(doc_list[idx].sci, mline);
+				editor_display_current_line(idx, 0.5F);
 			}
 			break;
 		}

Modified: trunk/src/sciwrappers.c
===================================================================
--- trunk/src/sciwrappers.c	2008-02-22 13:30:16 UTC (rev 2274)
+++ trunk/src/sciwrappers.c	2008-02-22 17:29:45 UTC (rev 2275)
@@ -401,9 +401,12 @@
 }
 
 
-void sci_set_current_line(ScintillaObject* sci, gint line )
+/* Set the cursor line without scrolling the view.
+ * Use sci_goto_line() to also scroll. */
+void sci_set_current_line(ScintillaObject* sci, gint line)
 {
-	SSM(sci, SCI_GOTOLINE, line, 0);
+	gint pos = sci_get_position_from_line(sci, line);
+	sci_set_current_position(sci, pos, FALSE);
 }
 
 


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