SF.net SVN: geany:[5075] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Jun 30 12:15:14 UTC 2010
Revision: 5075
http://geany.svn.sourceforge.net/geany/?rev=5075&view=rev
Author: ntrel
Date: 2010-06-30 12:15:13 +0000 (Wed, 30 Jun 2010)
Log Message:
-----------
Use SCI_SETFIRSTVISIBLELINE for editor_scroll_to_line(). Note this
doesn't affect the bug with document switching not scrolling cursor
in view after loading a session.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/editor.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-06-30 11:49:05 UTC (rev 5074)
+++ trunk/ChangeLog 2010-06-30 12:15:13 UTC (rev 5075)
@@ -5,6 +5,10 @@
//{ explicit folding, but that also disables stream comments /* */.
* tagmanager/tm_workspace.c, tagmanager/get.c:
Use g_free instead of free (patch by Daniel Marjamäki, thanks).
+ * src/editor.c:
+ Use SCI_SETFIRSTVISIBLELINE for editor_scroll_to_line(). Note this
+ doesn't affect the bug with document switching not scrolling cursor
+ in view after loading a session.
2010-06-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2010-06-30 11:49:05 UTC (rev 5074)
+++ trunk/src/editor.c 2010-06-30 12:15:13 UTC (rev 5075)
@@ -3733,7 +3733,7 @@
* line can be -1 to use the current position. */
void editor_scroll_to_line(GeanyEditor *editor, gint line, gfloat percent_of_view)
{
- gint vis1, los, delta;
+ gint los;
GtkWidget *wid;
g_return_if_fail(editor != NULL);
@@ -3750,10 +3750,9 @@
/* calling SCI_VISIBLEFROMDOCLINE for line is more accurate than calling
* SCI_DOCLINEFROMVISIBLE for vis1. */
line = SSM(editor->sci, SCI_VISIBLEFROMDOCLINE, line, 0);
- vis1 = SSM(editor->sci, SCI_GETFIRSTVISIBLELINE, 0, 0);
los = SSM(editor->sci, SCI_LINESONSCREEN, 0, 0);
- delta = (line - vis1) - los * percent_of_view;
- sci_scroll_lines(editor->sci, delta);
+ line = line - los * percent_of_view;
+ SSM(editor->sci, SCI_SETFIRSTVISIBLELINE, line, 0);
sci_scroll_caret(editor->sci); /* needed for 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