Revision: 1120 http://svn.sourceforge.net/geany/?rev=1120&view=rev Author: ntrel Date: 2006-12-18 07:58:00 -0800 (Mon, 18 Dec 2006)
Log Message: ----------- Scroll cursor to 50% of the view when reloading a file. Rename sci_goto_pos() argument 'unfold'.
Modified Paths: -------------- trunk/ChangeLog trunk/src/document.c trunk/src/sciwrappers.c trunk/src/sciwrappers.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-12-18 13:04:18 UTC (rev 1119) +++ trunk/ChangeLog 2006-12-18 15:58:00 UTC (rev 1120) @@ -15,6 +15,9 @@ src/document.c: Force a file changed check when attempting to open an already open file. + * src/sciwrappers.c, src/sciwrappers.h, src/document.c: + Scroll cursor to 50% of the view when reloading a file. + Rename sci_goto_pos() argument 'unfold'.
2006-12-17 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2006-12-18 13:04:18 UTC (rev 1119) +++ trunk/src/document.c 2006-12-18 15:58:00 UTC (rev 1120) @@ -688,7 +688,11 @@ cl_options.goto_line = -1; } else if (pos >= 0) - sci_goto_pos(doc_list[idx].sci, pos, TRUE); + { + sci_goto_pos(doc_list[idx].sci, pos, FALSE); + if (reload) + sci_scroll_to_line(doc_list[idx].sci, -1, 0.5); + }
if (! reload) {
Modified: trunk/src/sciwrappers.c =================================================================== --- trunk/src/sciwrappers.c 2006-12-18 13:04:18 UTC (rev 1119) +++ trunk/src/sciwrappers.c 2006-12-18 15:58:00 UTC (rev 1120) @@ -641,9 +641,9 @@ }
-void sci_goto_pos(ScintillaObject *sci, gint pos, gboolean ensure_visibility) +void sci_goto_pos(ScintillaObject *sci, gint pos, gboolean unfold) { - if (ensure_visibility) SSM(sci,SCI_ENSUREVISIBLE,SSM(sci, SCI_LINEFROMPOSITION, pos, 0),0); + if (unfold) SSM(sci,SCI_ENSUREVISIBLE,SSM(sci, SCI_LINEFROMPOSITION, pos, 0),0); SSM(sci, SCI_GOTOPOS, pos, 0); }
@@ -678,6 +678,7 @@ { gint vis1, los, delta;
+ if (GTK_WIDGET(sci)->allocation.height <= 1) return; // prevent gdk_window_scroll warning if (line == -1) line = sci_get_current_line(sci, -1);
Modified: trunk/src/sciwrappers.h =================================================================== --- trunk/src/sciwrappers.h 2006-12-18 13:04:18 UTC (rev 1119) +++ trunk/src/sciwrappers.h 2006-12-18 15:58:00 UTC (rev 1120) @@ -119,7 +119,7 @@ void sci_set_savepoint (ScintillaObject * sci); void sci_set_indentionguides (ScintillaObject * sci, gboolean enable); void sci_use_popup (ScintillaObject * sci, gboolean enable); -void sci_goto_pos (ScintillaObject * sci, gint pos, gboolean ensure_visibility); +void sci_goto_pos (ScintillaObject * sci, gint pos, gboolean unfold); void sci_set_search_anchor (ScintillaObject * sci); void sci_set_anchor (ScintillaObject * sci, gint pos); void sci_scroll_caret (ScintillaObject * sci);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.