From 6413fdb2bf664f39801df449916c5af97de2aa50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 15 Feb 2008 16:34:30 +0000 Subject: [PATCH] Add hidden preference to disable scrolling past end of document. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2260 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 3 +++ doc/geany.html | 14 +++++++++----- doc/geany.txt | 3 ++- src/document.c | 3 ++- src/editor.h | 7 ++++--- src/keyfile.c | 2 ++ src/plugindata.h | 2 +- 7 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d595603b3..efc45da50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ end of a multi line comment (closes #1894084). * src/socket.c: Apply patch from Daniel Richard G. to update some source code comments (thanks). + * doc/geany.html, doc/geany.txt, src/document.c, src/editor.h, + src/keyfile.c: + Add hidden preference to disable scrolling past end of document. 2008-02-13 Enrico Tröger diff --git a/doc/geany.html b/doc/geany.html index 7c5eb54de..bdf3841cc 100644 --- a/doc/geany.html +++ b/doc/geany.html @@ -3,7 +3,7 @@ - + Geany @@ -135,7 +135,7 @@ dt { Date: 2008-02-04 Version: -0.13 +0.14

Copyright © 2005-2008

@@ -2635,7 +2635,7 @@ gpl geanyversion The actual Geany version, e.g. -"Geany 0.13". +"Geany 0.14". filetypes, file header, function description, ChangeLog entry, bsd, gpl @@ -2686,7 +2686,7 @@ editing the file, to build the HTML document to see how your changes look, run "make doc" in the subdirectory doc of Geany's source directory. This regenerates the geany.html file. To generate a PDF file, use the command "make pdf" which should generate a file called -geany-0.13.pdf.

+geany-0.14.pdf.

After you are happy with your changes, create a patch:

 % svn diff geany.txt > foo.patch
@@ -2857,6 +2857,10 @@ commands).
 an existing line.
 false
 
+scroll_stop_at_last_line
+Disable scrolling past end of document
+false
+
 [interface]
  
  
@@ -3386,7 +3390,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.

diff --git a/doc/geany.txt b/doc/geany.txt index 38ae12239..3190170df 100644 --- a/doc/geany.txt +++ b/doc/geany.txt @@ -1,4 +1,4 @@ -.. |(version)| replace:: 0.13 +.. |(version)| replace:: 0.14 ======= Geany @@ -2502,6 +2502,7 @@ use_gtk_word_boundaries Whether to look for the end of a word when commands`_). auto_complete_whilst_editing Whether to allow autocompletion when editing false an existing line. +scroll_stop_at_last_line Disable scrolling past end of document false **[interface]** show_symbol_list_expanders Whether to show or hide the small expander true icons on the symbol list treeview (only diff --git a/src/document.c b/src/document.c index a5e0f92c2..2c064f739 100644 --- a/src/document.c +++ b/src/document.c @@ -422,7 +422,8 @@ static gint document_create_new_sci(const gchar *filename) sci_set_caret_policy_x(sci, CARET_JUMPS | CARET_EVEN, 0); //sci_set_caret_policy_y(sci, CARET_JUMPS | CARET_EVEN, 0); SSM(sci, SCI_AUTOCSETSEPARATOR, '\n', 0); - SSM(sci, SCI_SETENDATLASTLINE, FALSE, 0); // allow scrolling past end of document + // (dis)allow scrolling past end of document + SSM(sci, SCI_SETENDATLASTLINE, editor_prefs.scroll_stop_at_last_line, 0); // signal for insert-key(works without too, but to update the right status bar) //g_signal_connect((GtkWidget*) sci, "key-press-event", diff --git a/src/editor.h b/src/editor.h index 77de03544..3336ce447 100644 --- a/src/editor.h +++ b/src/editor.h @@ -51,9 +51,10 @@ typedef struct EditorPrefs gint long_line_type; gint long_line_column; gchar *long_line_color; - gboolean show_markers_margin; // view menu - gboolean show_linenumber_margin; // view menu - gboolean show_scrollbars; // hidden pref + gboolean show_markers_margin; // view menu + gboolean show_linenumber_margin; // view menu + gboolean show_scrollbars; // hidden pref + gboolean scroll_stop_at_last_line; // hidden pref // behaviour gboolean line_wrapping; diff --git a/src/keyfile.c b/src/keyfile.c index 573ff1b12..fa0b3947d 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -368,6 +368,7 @@ static void save_hidden_prefs(GKeyFile *config) write_hidden_pref_boolean(config, PACKAGE, "brace_match_ltgt", editor_prefs.brace_match_ltgt); write_hidden_pref_boolean(config, PACKAGE, "use_gtk_word_boundaries", editor_prefs.use_gtk_word_boundaries); write_hidden_pref_boolean(config, PACKAGE, "auto_complete_whilst_editing", editor_prefs.auto_complete_whilst_editing); + write_hidden_pref_boolean(config, PACKAGE, "scroll_stop_at_last_line", editor_prefs.scroll_stop_at_last_line); #if GTK_CHECK_VERSION(2, 12, 0) write_hidden_pref_boolean(config, PACKAGE, "show_symbol_list_expanders", prefs.show_symbol_list_expanders); #endif @@ -525,6 +526,7 @@ static void load_dialog_prefs(GKeyFile *config) editor_prefs.newline_strip = utils_get_setting_boolean(config, PACKAGE, "pref_editor_newline_strip", FALSE); editor_prefs.use_gtk_word_boundaries = utils_get_setting_boolean(config, PACKAGE, "use_gtk_word_boundaries", TRUE); editor_prefs.auto_complete_whilst_editing = utils_get_setting_boolean(config, PACKAGE, "auto_complete_whilst_editing", FALSE); + editor_prefs.scroll_stop_at_last_line = utils_get_setting_boolean(config, PACKAGE, "scroll_stop_at_last_line", FALSE); // Files // use current locale encoding as default for new files (should be UTF-8 in most cases) diff --git a/src/plugindata.h b/src/plugindata.h index 241f80e1d..2a6067fb0 100644 --- a/src/plugindata.h +++ b/src/plugindata.h @@ -93,7 +93,7 @@ /* The API version should be incremented whenever any plugin data types below are * modified or appended to. */ -static const gint api_version = 42; +static const gint api_version = 43; /* The ABI version should be incremented whenever existing fields in the plugin * data types below have to be changed or reordered. It should stay the same if fields