Revision: 2971 http://geany.svn.sourceforge.net/geany/?rev=2971&view=rev Author: ntrel Date: 2008-09-18 12:43:41 +0000 (Thu, 18 Sep 2008)
Log Message: ----------- Add 'Tab key indents' pref, which replaces hidden pref 'use_tab_to_indent'; it's now on by default.
Modified Paths: -------------- trunk/ChangeLog trunk/doc/geany.html trunk/doc/geany.txt trunk/geany.glade trunk/src/document.c trunk/src/editor.c trunk/src/editor.h trunk/src/interface.c trunk/src/keyfile.c trunk/src/prefs.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/ChangeLog 2008-09-18 12:43:41 UTC (rev 2971) @@ -7,6 +7,11 @@ * src/plugindata.h: Fix ScintillaFuncs::indic_clear() return type, and rename to indicator_clear(). + * src/interface.c, src/prefs.c, src/keyfile.c, src/document.c, + src/editor.c, src/editor.h, doc/geany.txt, doc/geany.html, + geany.glade: + Add 'Tab key indents' pref, which replaces hidden pref + 'use_tab_to_indent'; it's now on by default.
2008-09-17 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/doc/geany.html =================================================================== --- trunk/doc/geany.html 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/doc/geany.html 2008-09-18 12:43:41 UTC (rev 2971) @@ -1723,6 +1723,18 @@ <tt class="docutils literal"><span class="pre">}</span></tt> brace line up with the matching opening brace.</dd> </dl> </dd> +<dt>Tab key indents</dt> +<dd><p class="first">If set, pressing tab will indent the current line or selection, and +unindent when pressing Shift-tab. Otherwise, the tab key will +insert a tab character into the document (which can be different +from indentation, depending on the indent type).</p> +<div class="last note"> +<p class="first admonition-title">Note</p> +<p class="last">There are also separate configurable keybindings for indent & +unindent, but this pref allows the tab key to have different +meanings in different contexts - e.g. for snippet completion.</p> +</div> +</dd> </dl> </div> <div class="section"> @@ -3640,11 +3652,6 @@ scrollbars are hidden completely.</td> <td>true</td> </tr> -<tr><td>use_tab_to_indent</td> -<td>Whether pressing tab when a line is -selected will indent the line.</td> -<td>true</td> -</tr> <tr><td>use_gtk_word_boundaries</td> <td>Whether to look for the end of a word when using word-boundary related Scintilla @@ -4240,7 +4247,7 @@ <div class="footer"> <hr class="footer" /> <a class="reference" href="geany.txt">View document source</a>. -Generated on: 2008-09-17 16:47 UTC. +Generated on: 2008-09-18 12:00 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-18 11:47:48 UTC (rev 2970) +++ trunk/doc/geany.txt 2008-09-18 12:43:41 UTC (rev 2971) @@ -1482,6 +1482,17 @@ Like *Current chars* but for C-like languages, make a closing ``}`` brace line up with the matching opening brace.
+Tab key indents + If set, pressing tab will indent the current line or selection, and + unindent when pressing Shift-tab. Otherwise, the tab key will + insert a tab character into the document (which can be different + from indentation, depending on the indent type). + + .. note:: + There are also separate configurable keybindings for indent & + unindent, but this pref allows the tab key to have different + meanings in different contexts - e.g. for snippet completion. + Features ````````
@@ -3242,8 +3253,6 @@ show_editor_scrollbars Whether to display scrollbars. If set to true false, the horizontal and vertical scrollbars are hidden completely. -use_tab_to_indent Whether pressing tab when a line is true - selected will indent the line. use_gtk_word_boundaries Whether to look for the end of a word when true using word-boundary related Scintilla commands (see `Scintilla keyboard
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/geany.glade 2008-09-18 12:43:41 UTC (rev 2971) @@ -5702,6 +5702,26 @@ <property name="fill">True</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="check_tab_key_indents"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Pressing tab/shift-tab indents/unindents instead of inserting a tab character.</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Tab key indents</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> @@ -5847,7 +5867,7 @@ <property name="visible">True</property> <property name="tooltip" translatable="yes">Fold or unfold all children of a fold point. By pressing the Shift key while clicking on a fold symbol the contrary behavior is used.</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Fold/Unfold all children of a fold point</property> + <property name="label" translatable="yes">Fold/unfold all children of a fold point</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> @@ -6050,10 +6070,6 @@ <property name="fill">True</property> </packing> </child> - - <child> - <placeholder/> - </child> </widget> <packing> <property name="tab_expand">False</property>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/src/document.c 2008-09-18 12:43:41 UTC (rev 2971) @@ -315,6 +315,7 @@
/* update indent width, tab width */ editor_set_indent_type(editor, editor->indent_type); + sci_set_tab_indents(sci, editor_prefs.use_tab_to_indent);
sci_set_autoc_max_height(sci, editor_prefs.symbolcompletion_max_height);
@@ -482,12 +483,12 @@ geany_debug("Error: page_num: %d", page_num); return FALSE; } - + if (doc->changed && ! dialogs_show_unsaved_file(doc)) { return FALSE; } - + /* tell any plugins that the document is about to be closed */ if (geany_object) {
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/src/editor.c 2008-09-18 12:43:41 UTC (rev 2971) @@ -3768,7 +3768,6 @@
setup_sci_keys(sci);
- sci_set_tab_indents(sci, editor_prefs.use_tab_to_indent); sci_set_symbol_margin(sci, editor_prefs.show_markers_margin); sci_set_lines_wrapped(sci, editor_prefs.line_wrapping); sci_set_scrollbar_mode(sci, editor_prefs.show_scrollbars);
Modified: trunk/src/editor.h =================================================================== --- trunk/src/editor.h 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/src/editor.h 2008-09-18 12:43:41 UTC (rev 2971) @@ -89,7 +89,7 @@ gboolean folding; gboolean unfold_all_children; gboolean disable_dnd; - gboolean use_tab_to_indent; /* hidden pref makes pressing Tab key like Ctrl-I */ + gboolean use_tab_to_indent; /* makes tab key indent instead of insert a tab char */ gboolean smart_home_key; gboolean newline_strip; gboolean auto_complete_symbols;
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/src/interface.c 2008-09-18 12:43:41 UTC (rev 2971) @@ -2703,6 +2703,7 @@ GtkObject *spin_tab_width_adj; GtkWidget *spin_tab_width; GtkWidget *check_detect_indent; + GtkWidget *check_tab_key_indents; GtkWidget *label195; GtkWidget *frame14; GtkWidget *alignment17; @@ -3694,6 +3695,11 @@ (GtkAttachOptions) (0), 0, 0); gtk_tooltips_set_tip (tooltips, check_detect_indent, _("Whether to detect the indentation type from file contents when a file is opened."), NULL);
+ check_tab_key_indents = gtk_check_button_new_with_mnemonic (_("Tab key indents")); + gtk_widget_show (check_tab_key_indents); + gtk_box_pack_start (GTK_BOX (vbox25), check_tab_key_indents, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, check_tab_key_indents, _("Pressing tab/shift-tab indents/unindents instead of inserting a tab character."), NULL); + label195 = gtk_label_new (_("<b>Indentation</b>")); gtk_widget_show (label195); gtk_frame_set_label_widget (GTK_FRAME (frame27), label195); @@ -3733,7 +3739,7 @@ gtk_box_pack_start (GTK_BOX (vbox17), check_folding, FALSE, FALSE, 0); gtk_tooltips_set_tip (tooltips, check_folding, _("Whether to enable folding the code"), NULL);
- check_unfold_children = gtk_check_button_new_with_mnemonic (_("Fold/Unfold all children of a fold point")); + check_unfold_children = gtk_check_button_new_with_mnemonic (_("Fold/unfold all children of a fold point")); gtk_widget_show (check_unfold_children); gtk_box_pack_start (GTK_BOX (vbox17), check_unfold_children, FALSE, FALSE, 0); gtk_tooltips_set_tip (tooltips, check_unfold_children, _("Fold or unfold all children of a fold point. By pressing the Shift key while clicking on a fold symbol the contrary behavior is used."), NULL); @@ -4920,6 +4926,7 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, label221, "label221"); GLADE_HOOKUP_OBJECT (prefs_dialog, spin_tab_width, "spin_tab_width"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_detect_indent, "check_detect_indent"); + GLADE_HOOKUP_OBJECT (prefs_dialog, check_tab_key_indents, "check_tab_key_indents"); GLADE_HOOKUP_OBJECT (prefs_dialog, label195, "label195"); GLADE_HOOKUP_OBJECT (prefs_dialog, frame14, "frame14"); GLADE_HOOKUP_OBJECT (prefs_dialog, alignment17, "alignment17");
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/src/keyfile.c 2008-09-18 12:43:41 UTC (rev 2971) @@ -120,7 +120,8 @@ {&search_prefs.use_current_word, PACKAGE, "pref_main_search_use_current_word", (gpointer)TRUE}, {&search_prefs.use_current_file_dir, "search", "pref_search_current_file_dir", (gpointer)TRUE},
- {&editor_prefs.indentation->detect_type, PACKAGE, "check_detect_indent", (gpointer)FALSE} + {&editor_prefs.indentation->detect_type, PACKAGE, "check_detect_indent", (gpointer)FALSE}, + {&editor_prefs.use_tab_to_indent, PACKAGE, "use_tab_to_indent", (gpointer)TRUE} };
for (i = 0; i < G_N_ELEMENTS(items); i++) @@ -493,7 +494,6 @@ static void save_hidden_prefs(GKeyFile *config) { write_hidden_pref_boolean(config, PACKAGE, "show_editor_scrollbars", editor_prefs.show_scrollbars); - write_hidden_pref_boolean(config, PACKAGE, "use_tab_to_indent", editor_prefs.use_tab_to_indent); 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); @@ -632,7 +632,6 @@ editor_prefs.symbolcompletion_min_chars = utils_get_setting_integer(config, PACKAGE, "symbolcompletion_min_chars", GEANY_MIN_SYMBOLLIST_CHARS); editor_prefs.symbolcompletion_max_height = utils_get_setting_integer(config, PACKAGE, "symbolcompletion_max_height", GEANY_MAX_SYMBOLLIST_HEIGHT); editor_prefs.line_wrapping = utils_get_setting_boolean(config, PACKAGE, "line_wrapping", FALSE); /* default is off for better performance */ - editor_prefs.use_tab_to_indent = utils_get_setting_boolean(config, PACKAGE, "use_tab_to_indent", FALSE); editor_prefs.use_indicators = utils_get_setting_boolean(config, PACKAGE, "use_indicators", TRUE); 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);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2008-09-18 11:47:48 UTC (rev 2970) +++ trunk/src/prefs.c 2008-09-18 12:43:41 UTC (rev 2971) @@ -116,7 +116,8 @@ {"check_search_use_current_word", &search_prefs.use_current_word}, {"check_fif_current_dir", &search_prefs.use_current_file_dir},
- {"check_detect_indent", &editor_prefs.indentation->detect_type} + {"check_detect_indent", &editor_prefs.indentation->detect_type}, + {"check_tab_key_indents", &editor_prefs.use_tab_to_indent} };
for (i = 0; i < G_N_ELEMENTS(items); i++)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.