From e123af1c55a922800c610366b9f8f2b1f52cd08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Fri, 30 Mar 2007 10:38:13 +0000 Subject: [PATCH] Fixed warning about shadowing a local variable. Add keybinding for switching to the search bar (as suggested by Nikolas Arend). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1430 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 8 ++++++++ doc/geany.docbook | 4 ++++ src/keybindings.c | 9 +++++++++ src/keybindings.h | 1 + src/sci_cb.c | 6 +++--- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0565a9d7..4ecc641a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-03-30 Enrico Tröger + + * src/sci_cb.c: Fixed warning about shadowing a local variable. + * doc_geany.docbook, src/keybindings.c, src/keybindings.h: + Add keybinding for switching to the search bar + (as suggested by Nikolas Arend). + + 2007-03-29 Nick Treleaven * src/sci_cb.c: diff --git a/doc/geany.docbook b/doc/geany.docbook index 3937863c..5e70911a 100644 --- a/doc/geany.docbook +++ b/doc/geany.docbook @@ -1420,6 +1420,10 @@ Switch to VTE Switches to VTE widget. + + Switch to Search Bar + Switches to the search bar in the toolbar (if visible). + Switch to left document Switches to the previous open document. diff --git a/src/keybindings.c b/src/keybindings.c index 545289d3..42f8257a 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -90,6 +90,7 @@ static void cb_func_reloadtaglist(guint key_id); static void cb_func_switch_editor(guint key_id); static void cb_func_switch_scribble(guint key_id); static void cb_func_switch_vte(guint key_id); +static void cb_func_switch_search_bar(guint key_id); static void cb_func_switch_tableft(guint key_id); static void cb_func_switch_tabright(guint key_id); static void cb_func_switch_tablastused(guint key_id); @@ -207,6 +208,8 @@ void keybindings_init(void) GDK_F6, 0, "switch_scribble", _("Switch to Scribble")); keys[GEANY_KEYS_SWITCH_VTE] = fill(cb_func_switch_vte, GDK_F4, 0, "switch_vte", _("Switch to VTE")); + keys[GEANY_KEYS_SWITCH_SEARCH_BAR] = fill(cb_func_switch_search_bar, + GDK_F7, 0, "switch_search_bar", _("Switch to Search Bar")); keys[GEANY_KEYS_SWITCH_TABLEFT] = fill(cb_func_switch_tableft, GDK_Page_Up, GDK_CONTROL_MASK, "switch_tableft", _("Switch to left document")); keys[GEANY_KEYS_SWITCH_TABRIGHT] = fill(cb_func_switch_tabright, @@ -918,6 +921,12 @@ static void cb_func_switch_scribble(G_GNUC_UNUSED guint key_id) gtk_widget_grab_focus(lookup_widget(app->window, "textview_scribble")); } +static void cb_func_switch_search_bar(G_GNUC_UNUSED guint key_id) +{ + if (app->toolbar_visible && app->pref_toolbar_show_search) + gtk_widget_grab_focus(lookup_widget(app->window, "entry1")); +} + static void cb_func_switch_vte(G_GNUC_UNUSED guint key_id) { #ifdef HAVE_VTE diff --git a/src/keybindings.h b/src/keybindings.h index 3b8a30b2..161dbb7c 100644 --- a/src/keybindings.h +++ b/src/keybindings.h @@ -100,6 +100,7 @@ enum GEANY_KEYS_SWITCH_EDITOR, GEANY_KEYS_SWITCH_SCRIBBLE, GEANY_KEYS_SWITCH_VTE, + GEANY_KEYS_SWITCH_SEARCH_BAR, GEANY_KEYS_SWITCH_TABLEFT, GEANY_KEYS_SWITCH_TABRIGHT, GEANY_KEYS_SWITCH_TABLASTUSED, diff --git a/src/sci_cb.c b/src/sci_cb.c index abb61123..3213a0b1 100644 --- a/src/sci_cb.c +++ b/src/sci_cb.c @@ -396,9 +396,9 @@ static gboolean lexer_has_braces(ScintillaObject *sci) // in place indentation of one tab or equivalent spaces -static void do_indent(gchar *buf, gsize len, guint *index) +static void do_indent(gchar *buf, gsize len, guint *idx) { - guint j = *index; + guint j = *idx; if (app->pref_editor_use_tabs) { @@ -411,7 +411,7 @@ static void do_indent(gchar *buf, gsize len, guint *index) for (k = 0; k < (guint) app->pref_editor_tab_width && k < len - 1; k++) buf[j++] = ' '; } - *index = j; + *idx = j; }