Move and rename the bash shortcuts hidden preference - it's now in

geany.conf, [VTE] section, called 'enable_bash_keys'.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1927 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-10-02 16:20:44 +00:00
parent d910f01d0f
commit 5b6b03c058
7 changed files with 53 additions and 25 deletions

View File

@ -4,6 +4,10 @@
Attempt to fix problem with tab close button size. Attempt to fix problem with tab close button size.
* src/keyfile.c, doc/geany.txt, doc/geany.html: * src/keyfile.c, doc/geany.txt, doc/geany.html:
Don't overwrite hidden prefs when quitting unless they are missing. Don't overwrite hidden prefs when quitting unless they are missing.
* src/keybindings.c, src/keyfile.c, src/vte.h, doc/geany.txt,
doc/geany.html, NEWS:
Move and rename the bash shortcuts hidden preference - it's now in
geany.conf, [VTE] section, called 'enable_bash_keys'.
2007-10-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> 2007-10-01 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>

4
NEWS
View File

@ -3,7 +3,6 @@ Geany 0.12 (TBA)
Bugs fixed: Bugs fixed:
* Fixed opening the same file twice from the message window/command-line. * Fixed opening the same file twice from the message window/command-line.
* Fixed Ctrl-Shift keybindings not working when caps lock is on. * Fixed Ctrl-Shift keybindings not working when caps lock is on.
* Fixed common bash Ctrl-[a-z] keyboard shortcuts not working in the VTE.
* Fixed saving the wrong document when using Save All with unnamed * Fixed saving the wrong document when using Save All with unnamed
documents. documents.
* Fixed replacing with '^' or '$' regex chars. * Fixed replacing with '^' or '$' regex chars.
@ -11,6 +10,7 @@ Geany 0.12 (TBA)
* Fixed hang when replacing all '[ ]*' regex matches (closes #1757748). * Fixed hang when replacing all '[ ]*' regex matches (closes #1757748).
* Fixed displaying error indicators with Make after entering a * Fixed displaying error indicators with Make after entering a
subdirectory. subdirectory.
* Fixed a possible segfault when parsing tags (a vString bug).
Filetypes: Filetypes:
* Added reStructuredText filetype and parser. * Added reStructuredText filetype and parser.
@ -26,6 +26,8 @@ Geany 0.12 (TBA)
* Added Class Builder plugin (thanks to Alexander Rodin). * Added Class Builder plugin (thanks to Alexander Rodin).
Keyboard shorcuts: Keyboard shorcuts:
* Common bash Ctrl-[a-z] keyboard shortcuts now work when the VTE is
focused, and there is an 'enable_bash_keys' hidden preference.
* Added 'Move document left' and 'Move document right' keybindings. * Added 'Move document left' and 'Move document right' keybindings.
* Added Find keybinding. * Added Find keybinding.
* Made fixed keybindings overridable. * Made fixed keybindings overridable.

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title> <title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" /> <meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
<meta name="date" content="2007-09-28" /> <meta name="date" content="2007-10-02" />
<style type="text/css"> <style type="text/css">
/* /*
@ -133,7 +133,7 @@ dt {
<br />Nick Treleaven <br />Nick Treleaven
<br />Frank Lanitz</td></tr> <br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th> <tr><th class="docinfo-name">Date:</th>
<td>2007-09-28</td></tr> <td>2007-10-02</td></tr>
<tr><th class="docinfo-name">Version:</th> <tr><th class="docinfo-name">Version:</th>
<td>0.12</td></tr> <td>0.12</td></tr>
</tbody> </tbody>
@ -2512,13 +2512,13 @@ menus. Some less common commands with no menu equivalent are:</p>
</div> </div>
<div class="section"> <div class="section">
<h1><a class="toc-backref" href="#id103" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1> <h1><a class="toc-backref" href="#id103" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1>
<p>There are some uncommon preferences that are not shown in the <p>There are some uncommon preferences that are not shown in the Preferences
Preferences dialog. These can be set by editing <tt class="docutils literal"><span class="pre">~/.geany/geany.conf</span></tt>, dialog. These can be set by editing <tt class="docutils literal"><span class="pre">~/.geany/geany.conf</span></tt>, then
then restarting Geany. Search for the key name, then edit the value. Example:</p> restarting Geany. Search for the key name, then edit the value. Example:</p>
<blockquote> <blockquote>
<tt class="docutils literal"><span class="pre">brace_match_ltgt=true</span></tt></blockquote> <tt class="docutils literal"><span class="pre">brace_match_ltgt=true</span></tt></blockquote>
<p>The table below refers to the key names in the configuration file, <p>The table below show the key names of hidden preferences in the
under the <tt class="docutils literal"><span class="pre">[geany]</span></tt> group.</p> configuration file.</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
<colgroup> <colgroup>
<col width="33%" /> <col width="33%" />
@ -2526,12 +2526,16 @@ under the <tt class="docutils literal"><span class="pre">[geany]</span></tt> gro
<col width="20%" /> <col width="20%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th class="head">Option</th> <tr><th class="head">Key</th>
<th class="head">Description</th> <th class="head">Description</th>
<th class="head">Default</th> <th class="head">Default</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
<tr><td><strong>[geany]</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr><td>brace_match_ltgt</td> <tr><td>brace_match_ltgt</td>
<td>Whether to highlight &lt;, &gt; angle brackets.</td> <td>Whether to highlight &lt;, &gt; angle brackets.</td>
<td>false</td> <td>false</td>
@ -2558,6 +2562,16 @@ commands</a>).</td>
an existing line.</td> an existing line.</td>
<td>false</td> <td>false</td>
</tr> </tr>
<tr><td><strong>[VTE]</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr><td>enable_bash_keys</td>
<td>Whether to allow bash shell keyboard
shortcuts like Ctrl-W to delete the last
word, when the VTE is focused.</td>
<td>true</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -3072,7 +3086,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer"> <div class="footer">
<hr class="footer" /> <hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>. <a class="reference" href="geany.txt">View document source</a>.
Generated on: 2007-10-02 15:43 UTC. Generated on: 2007-10-02 16:10 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. 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> </div>

View File

@ -2277,18 +2277,19 @@ Next word part. Ctrl+\\
Hidden preferences Hidden preferences
================== ==================
There are some uncommon preferences that are not shown in the There are some uncommon preferences that are not shown in the Preferences
Preferences dialog. These can be set by editing ``~/.geany/geany.conf``, dialog. These can be set by editing ``~/.geany/geany.conf``, then
then restarting Geany. Search for the key name, then edit the value. Example: restarting Geany. Search for the key name, then edit the value. Example:
``brace_match_ltgt=true`` ``brace_match_ltgt=true``
The table below refers to the key names in the configuration file, The table below show the key names of hidden preferences in the
under the ``[geany]`` group. configuration file.
============================== ============================================ ================== ============================== ============================================ ==================
Key Description Default Key Description Default
============================== ============================================ ================== ============================== ============================================ ==================
**[geany]**
brace_match_ltgt Whether to highlight <, > angle brackets. false brace_match_ltgt Whether to highlight <, > angle brackets. false
show_editor_scrollbars Whether to display scrollbars when the true show_editor_scrollbars Whether to display scrollbars when the true
editor window is bigger than the display. editor window is bigger than the display.
@ -2300,6 +2301,10 @@ use_gtk_word_boundaries Whether to look for the end of a word when
commands`_). commands`_).
auto_complete_whilst_editing Whether to allow autocompletion when editing false auto_complete_whilst_editing Whether to allow autocompletion when editing false
an existing line. an existing line.
**[VTE]**
enable_bash_keys Whether to allow bash shell keyboard true
shortcuts like Ctrl-W to delete the last
word, when the VTE is focused.
============================== ============================================ ================== ============================== ============================================ ==================

View File

@ -47,7 +47,6 @@
static const gboolean swap_alt_tab_order = FALSE; static const gboolean swap_alt_tab_order = FALSE;
static gboolean enable_vte_bash_keys;
/* simple convenience function to allocate and fill the struct */ /* simple convenience function to allocate and fill the struct */
@ -345,8 +344,6 @@ static void load_user_kb()
g_free(val); g_free(val);
} }
} }
enable_vte_bash_keys =
utils_get_setting_boolean(config, "Settings", "enable_vte_bash_keys", TRUE);
g_free(configfile); g_free(configfile);
g_key_file_free(config); g_key_file_free(config);
} }
@ -680,14 +677,12 @@ static gboolean set_sensitive(gpointer widget)
} }
#ifdef HAVE_VTE
static gboolean check_vte(GdkEventKey *event, guint keyval) static gboolean check_vte(GdkEventKey *event, guint keyval)
{ {
#ifndef HAVE_VTE
return FALSE;
#else
GtkWidget *widget; GtkWidget *widget;
if (! vte_info.have_vte) if (! vc->enable_bash_keys)
return FALSE; return FALSE;
if (gtk_window_get_focus(GTK_WINDOW(app->window)) != vc->vte) if (gtk_window_get_focus(GTK_WINDOW(app->window)) != vc->vte)
return FALSE; return FALSE;
@ -731,8 +726,8 @@ static gboolean check_vte(GdkEventKey *event, guint keyval)
gtk_widget_set_sensitive(widget, FALSE); gtk_widget_set_sensitive(widget, FALSE);
g_idle_add(&set_sensitive, (gpointer) widget); g_idle_add(&set_sensitive, (gpointer) widget);
return TRUE; return TRUE;
#endif
} }
#endif
/* central keypress event handler, almost all keypress events go to this function */ /* central keypress event handler, almost all keypress events go to this function */
@ -755,8 +750,10 @@ gboolean keybindings_got_event(GtkWidget *widget, GdkEventKey *event, gpointer u
event->state -= GDK_MOD2_MASK; event->state -= GDK_MOD2_MASK;
// special cases // special cases
if (enable_vte_bash_keys && check_vte(event, keyval)) #ifdef HAVE_VTE
if (vte_info.have_vte && check_vte(event, keyval))
return FALSE; return FALSE;
#endif
if (check_construct_completion(event)) if (check_construct_completion(event))
return TRUE; return TRUE;

View File

@ -327,6 +327,10 @@ 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, "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, "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, "auto_complete_whilst_editing", editor_prefs.auto_complete_whilst_editing);
#ifdef HAVE_VTE
if (vte_info.have_vte)
write_hidden_pref_boolean(config, "VTE", "enable_bash_keys", vc->enable_bash_keys);
#endif
} }
@ -541,6 +545,7 @@ static void load_dialog_prefs(GKeyFile *config)
vc->ignore_menu_bar_accel = utils_get_setting_boolean(config, "VTE", "ignore_menu_bar_accel", FALSE); vc->ignore_menu_bar_accel = utils_get_setting_boolean(config, "VTE", "ignore_menu_bar_accel", FALSE);
vc->follow_path = utils_get_setting_boolean(config, "VTE", "follow_path", FALSE); vc->follow_path = utils_get_setting_boolean(config, "VTE", "follow_path", FALSE);
vc->run_in_vte = utils_get_setting_boolean(config, "VTE", "run_in_vte", FALSE); vc->run_in_vte = utils_get_setting_boolean(config, "VTE", "run_in_vte", FALSE);
vc->enable_bash_keys = utils_get_setting_boolean(config, "VTE", "enable_bash_keys", TRUE);
vc->scrollback_lines = utils_get_setting_integer(config, "VTE", "scrollback_lines", 500); vc->scrollback_lines = utils_get_setting_integer(config, "VTE", "scrollback_lines", 500);
vc->colour_fore = g_new0(GdkColor, 1); vc->colour_fore = g_new0(GdkColor, 1);
vc->colour_back = g_new0(GdkColor, 1); vc->colour_back = g_new0(GdkColor, 1);

View File

@ -54,6 +54,7 @@ typedef struct
gboolean ignore_menu_bar_accel; gboolean ignore_menu_bar_accel;
gboolean follow_path; gboolean follow_path;
gboolean run_in_vte; gboolean run_in_vte;
gboolean enable_bash_keys;
gint scrollback_lines; gint scrollback_lines;
gchar *emulation; gchar *emulation;
gchar *shell; gchar *shell;