Revision: 2918 http://geany.svn.sourceforge.net/geany/?rev=2918&view=rev Author: eht16 Date: 2008-09-01 11:18:06 +0000 (Mon, 01 Sep 2008)
Log Message: ----------- Add 'Stop scroll at last line' editor pref (patch by Timothy Boronczyk, thanks).
Modified Paths: -------------- trunk/ChangeLog trunk/THANKS trunk/doc/geany.html trunk/doc/geany.txt trunk/geany.glade trunk/src/document.c trunk/src/editor.c trunk/src/interface.c trunk/src/keyfile.c trunk/src/prefs.c trunk/src/sciwrappers.c trunk/src/sciwrappers.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/ChangeLog 2008-09-01 11:18:06 UTC (rev 2918) @@ -14,8 +14,14 @@ geany.spec.in, src/geany.h: New website address: www.geany.org. Merge README.I18N with latest from the wiki. + * doc/geany.html, doc/geany.txt, geany.glade, src/document.c, + src/editor.c, src/interface.c, src/keyfile.c, src/prefs.c, + src/sciwrappers.c, src/sciwrappers.h: + Add 'Stop scroll at last line' editor pref + (patch by Timothy Boronczyk, thanks).
+ 2008-08-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* doc/geany.txt, doc/geany.html:
Modified: trunk/THANKS =================================================================== --- trunk/THANKS 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/THANKS 2008-09-01 11:18:06 UTC (rev 2918) @@ -46,6 +46,7 @@ Robert McGinley <mcginleyr1(at)gmail(dot)com> - Documentation improvements Felipe Pena <felipensp(at)gmail(dot)com> - Missing PHP keywords Colomban Wendling <colombanw(at)users(dot)sourceforge(dot)net> - GLSL filetype patch +Timothy Boronczyk <tboronczyk(at)gmail(dot)com> - scroll_stop_at_last_line GUI pref patch
Translators: ------------
Modified: trunk/doc/geany.html =================================================================== --- trunk/doc/geany.html 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/doc/geany.html 2008-09-01 11:18:06 UTC (rev 2918) @@ -1812,6 +1812,9 @@ <dt>Show line endings</dt> <dd>Displays a symbol everywhere that a carriage return or line feed is present.</dd> +<dt>Stop scrolling at last line</dt> +<dd>When enabled Geany stops scrolling when at the last line of the document. +Otherwise you can scroll one more page even if there are no real lines.</dd> </dl> </div> <div class="section"> @@ -3659,10 +3662,6 @@ position on the line).</td> <td>false</td> </tr> -<tr><td>scroll_stop_at_last_line</td> -<td>Disable scrolling past end of document</td> -<td>true</td> -</tr> <tr><td><strong>[interface]</strong></td> <td> </td> <td> </td> @@ -4244,7 +4243,7 @@ <div class="footer"> <hr class="footer" /> <a class="reference" href="geany.txt">View document source</a>. -Generated on: 2008-09-01 09:23 UTC. +Generated on: 2008-09-01 10:13 UTC. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt =================================================================== --- trunk/doc/geany.txt 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/doc/geany.txt 2008-09-01 11:18:06 UTC (rev 2918) @@ -1585,6 +1585,11 @@ Displays a symbol everywhere that a carriage return or line feed is present.
+Stop scrolling at last line + When enabled Geany stops scrolling when at the last line of the document. + Otherwise you can scroll one more page even if there are no real lines. + + Long line marker ````````````````
@@ -3248,7 +3253,6 @@ when editing an existing line (i.e. there is some text after the current cursor position on the line). -scroll_stop_at_last_line Disable scrolling past end of document true **[interface]** show_symbol_list_expanders Whether to show or hide the small expander true icons on the symbol list treeview (only
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/geany.glade 2008-09-01 11:18:06 UTC (rev 2918) @@ -5355,7 +5355,6 @@ <child> <widget class="GtkNotebook" id="notebook4"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="show_tabs">True</property> <property name="show_border">True</property> <property name="tab_pos">GTK_POS_TOP</property> @@ -6507,7 +6506,7 @@ <child> <widget class="GtkCheckButton" id="check_line_end"> <property name="visible">True</property> - <property name="tooltip" translatable="yes">Show the line ending character</property> + <property name="tooltip" translatable="yes">Show the line ending character.</property> <property name="can_focus">True</property> <property name="label" translatable="yes">Show line endings</property> <property name="use_underline">True</property> @@ -6523,6 +6522,26 @@ <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="check_scroll_stop_at_last_line"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Whether to allow scrolling one page past the last line of a document.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Stop scrolling at last line</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> </child> </widget>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/document.c 2008-09-01 11:18:06 UTC (rev 2918) @@ -324,6 +324,9 @@
sci_set_folding_margin_visible(sci, editor_prefs.folding);
+ /* (dis)allow scrolling past end of document */ + sci_set_scroll_stop_at_last_line(sci, editor_prefs.scroll_stop_at_last_line); + sci_assign_cmdkey(sci, SCK_HOME, editor_prefs.smart_home_key ? SCI_VCHOMEWRAP : SCI_HOMEWRAP); sci_assign_cmdkey(sci, SCK_END, SCI_LINEENDWRAP);
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/editor.c 2008-09-01 11:18:06 UTC (rev 2918) @@ -3777,8 +3777,6 @@ 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); - /* (dis)allow scrolling past end of document */ - SSM(sci, SCI_SETENDATLASTLINE, editor_prefs.scroll_stop_at_last_line, 0); SSM(sci, SCI_SETSCROLLWIDTHTRACKING, 1, 0);
/* signal for insert-key(works without too, but to update the right status bar) */
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/interface.c 2008-09-01 11:18:06 UTC (rev 2918) @@ -2750,6 +2750,7 @@ GtkWidget *check_indent; GtkWidget *check_white_space; GtkWidget *check_line_end; + GtkWidget *check_scroll_stop_at_last_line; GtkWidget *label102; GtkWidget *frame8; GtkWidget *alignment11; @@ -3566,6 +3567,7 @@ notebook4 = gtk_notebook_new (); gtk_widget_show (notebook4); gtk_container_add (GTK_CONTAINER (notebook2), notebook4); + GTK_WIDGET_UNSET_FLAGS (notebook4, GTK_CAN_FOCUS);
vbox5 = gtk_vbox_new (FALSE, 10); gtk_widget_show (vbox5); @@ -3916,8 +3918,13 @@ check_line_end = gtk_check_button_new_with_mnemonic (_("Show line endings")); gtk_widget_show (check_line_end); gtk_box_pack_start (GTK_BOX (vbox12), check_line_end, FALSE, FALSE, 0); - gtk_tooltips_set_tip (tooltips, check_line_end, _("Show the line ending character"), NULL); + gtk_tooltips_set_tip (tooltips, check_line_end, _("Show the line ending character."), NULL);
+ check_scroll_stop_at_last_line = gtk_check_button_new_with_mnemonic (_("Stop scrolling at last line")); + gtk_widget_show (check_scroll_stop_at_last_line); + gtk_box_pack_start (GTK_BOX (vbox12), check_scroll_stop_at_last_line, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, check_scroll_stop_at_last_line, _("Whether to allow scrolling one page past the last line of a document."), NULL); + label102 = gtk_label_new (_("<b>Display</b>")); gtk_widget_show (label102); gtk_frame_set_label_widget (GTK_FRAME (frame5), label102); @@ -4956,6 +4963,7 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, check_indent, "check_indent"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_white_space, "check_white_space"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_line_end, "check_line_end"); + GLADE_HOOKUP_OBJECT (prefs_dialog, check_scroll_stop_at_last_line, "check_scroll_stop_at_last_line"); GLADE_HOOKUP_OBJECT (prefs_dialog, label102, "label102"); GLADE_HOOKUP_OBJECT (prefs_dialog, frame8, "frame8"); GLADE_HOOKUP_OBJECT (prefs_dialog, alignment11, "alignment11");
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/keyfile.c 2008-09-01 11:18:06 UTC (rev 2918) @@ -346,6 +346,7 @@ g_key_file_set_integer(config, PACKAGE, "line_break_column", editor_prefs.line_break_column); g_key_file_set_boolean(config, PACKAGE, "auto_continue_multiline", editor_prefs.auto_continue_multiline); g_key_file_set_string(config, PACKAGE, "comment_toggle_mark", editor_prefs.comment_toggle_mark); + g_key_file_set_boolean(config, PACKAGE, "scroll_stop_at_last_line", editor_prefs.scroll_stop_at_last_line);
/* files */ g_key_file_set_string(config, PACKAGE, "pref_editor_default_new_encoding", encodings[file_prefs.default_new_encoding].charset); @@ -496,7 +497,6 @@ 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, "complete_snippets_whilst_editing", editor_prefs.complete_snippets_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", interface_prefs.show_symbol_list_expanders); #endif @@ -637,6 +637,7 @@ editor_prefs.show_indent_guide = utils_get_setting_boolean(config, PACKAGE, "show_indent_guide", FALSE); editor_prefs.show_white_space = utils_get_setting_boolean(config, PACKAGE, "show_white_space", FALSE); editor_prefs.show_line_endings = utils_get_setting_boolean(config, PACKAGE, "show_line_endings", FALSE); + editor_prefs.scroll_stop_at_last_line = utils_get_setting_boolean(config, PACKAGE, "scroll_stop_at_last_line", TRUE); editor_prefs.auto_close_xml_tags = utils_get_setting_boolean(config, PACKAGE, "auto_close_xml_tags", TRUE); editor_prefs.complete_snippets = utils_get_setting_boolean(config, PACKAGE, "complete_snippets", TRUE); editor_prefs.auto_complete_symbols = utils_get_setting_boolean(config, PACKAGE, "auto_complete_symbols", TRUE); @@ -651,7 +652,6 @@ 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.complete_snippets_whilst_editing = utils_get_setting_boolean(config, PACKAGE, "complete_snippets_whilst_editing", FALSE); - editor_prefs.scroll_stop_at_last_line = utils_get_setting_boolean(config, PACKAGE, "scroll_stop_at_last_line", TRUE); editor_prefs.line_break_column = utils_get_setting_integer(config, PACKAGE, "line_break_column", 72); editor_prefs.auto_continue_multiline = utils_get_setting_boolean(config, PACKAGE, "auto_continue_multiline", TRUE); editor_prefs.comment_toggle_mark = utils_get_setting_string(config, PACKAGE, "comment_toggle_mark", GEANY_TOGGLE_MARK);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/prefs.c 2008-09-01 11:18:06 UTC (rev 2918) @@ -548,6 +548,9 @@ widget = lookup_widget(ui_widgets.prefs_dialog, "check_line_end"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.show_line_endings);
+ widget = lookup_widget(ui_widgets.prefs_dialog, "check_scroll_stop_at_last_line"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.scroll_stop_at_last_line); + widget = lookup_widget(ui_widgets.prefs_dialog, "check_line_wrapping"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.line_wrapping);
@@ -944,6 +947,9 @@ widget = lookup_widget(ui_widgets.prefs_dialog, "check_line_end"); editor_prefs.show_line_endings = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = lookup_widget(ui_widgets.prefs_dialog, "check_scroll_stop_at_last_line"); + editor_prefs.scroll_stop_at_last_line = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + widget = lookup_widget(ui_widgets.prefs_dialog, "check_line_wrapping"); editor_prefs.line_wrapping = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
Modified: trunk/src/sciwrappers.c =================================================================== --- trunk/src/sciwrappers.c 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/sciwrappers.c 2008-09-01 11:18:06 UTC (rev 2918) @@ -987,3 +987,7 @@ SSM(sci, SCI_SETYCARETPOLICY, policy, slop); }
+void sci_set_scroll_stop_at_last_line(ScintillaObject* sci, gboolean set) +{ + SSM(sci, SCI_SETENDATLASTLINE, set, 0); +} \ No newline at end of file
Modified: trunk/src/sciwrappers.h =================================================================== --- trunk/src/sciwrappers.h 2008-09-01 11:15:16 UTC (rev 2917) +++ trunk/src/sciwrappers.h 2008-09-01 11:18:06 UTC (rev 2918) @@ -176,4 +176,5 @@ void sci_set_caret_policy_x (ScintillaObject * sci, gint policy, gint slop); void sci_set_caret_policy_y (ScintillaObject * sci, gint policy, gint slop);
+void sci_set_scroll_stop_at_last_line (ScintillaObject* sci, gboolean set); #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.