diff --git a/ChangeLog b/ChangeLog index a361ecafe..714aa4e78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2007-06-03 Enrico Tröger + + * doc/geany.docbook, src/keybindings.c, src/keybindings.h: + Add keybindings for forward/back code navigation. + + +2007-06-02 Enrico Tröger + + * geany.glade, src/callbacks.c, src/callbacks.h, src/geany.h, + src/interface.c, src/keyfile.c, src/main.c, src/Makefile.am, + src/navqueue.h, src/navqueue.c, src/prefs.c, src/ui_utils.c: + Applied patch from Dave Moore to add simple code navigation + (thank you). + + 2007-05-31 Enrico Tröger * src/templates.c: Add Haskell to make_comment_block(). diff --git a/doc/geany.docbook b/doc/geany.docbook index 7c22fbd49..c690b671b 100644 --- a/doc/geany.docbook +++ b/doc/geany.docbook @@ -1728,6 +1728,14 @@ widget "GeanyPrefsDialog" style "geanyStyle" Switch to last used document Switches to the previously selected open document. + + Navigate forward a location + Switches to the next location in the navigation history. + + + Navigate back a location + Switches to the previous location in the navigation history. + Editing operations diff --git a/src/keybindings.c b/src/keybindings.c index 7316b75a9..1e3cce3ff 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -40,6 +40,7 @@ #include "sciwrappers.h" #include "build.h" #include "tools.h" +#include "navqueue.h" // include vte.h on non-Win32 systems, else define fake vte_init #ifdef HAVE_VTE # include "vte.h" @@ -94,6 +95,8 @@ 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); +static void cb_func_nav_back(guint key_id); +static void cb_func_nav_forward(guint key_id); static void cb_func_toggle_sidebar(guint key_id); // common function for editing keybindings, only valid when scintilla has focus. @@ -230,6 +233,10 @@ void keybindings_init(void) GDK_Page_Down, GDK_CONTROL_MASK, "switch_tabright", _("Switch to right document")); keys[GEANY_KEYS_SWITCH_TABLASTUSED] = fill(cb_func_switch_tablastused, GDK_Tab, GDK_CONTROL_MASK, "switch_tablastused", _("Switch to last used document")); + keys[GEANY_KEYS_NAV_BACK] = fill(cb_func_nav_back, + 0, 0, "nav_back", _("Navigate back a location")); + keys[GEANY_KEYS_NAV_FORWARD] = fill(cb_func_nav_forward, + 0, 0, "nav_forward", _("Navigate forward a location")); keys[GEANY_KEYS_EDIT_DUPLICATELINE] = fill(cb_func_edit, GDK_d, GDK_CONTROL_MASK, "edit_duplicateline", _("Duplicate line or selection")); @@ -1154,3 +1161,12 @@ static void cb_func_menu_insert_specialchars(G_GNUC_UNUSED guint key_id) on_menu_insert_special_chars1_activate(NULL, NULL); } +static void cb_func_nav_back(G_GNUC_UNUSED guint key_id) +{ + navqueue_go_back(); +} + +static void cb_func_nav_forward(G_GNUC_UNUSED guint key_id) +{ + navqueue_go_forward(); +} diff --git a/src/keybindings.h b/src/keybindings.h index b864bc391..22787064d 100644 --- a/src/keybindings.h +++ b/src/keybindings.h @@ -32,7 +32,7 @@ typedef struct binding { guint key; GdkModifierType mods; - // at the moment only needed as keys for the configuration file because indices or tranlatable + // at the moment only needed as keys for the configuration file because indices or translatable // strings as keys are not very useful const gchar *name; const gchar *label; @@ -107,6 +107,8 @@ enum GEANY_KEYS_SWITCH_TABLEFT, GEANY_KEYS_SWITCH_TABRIGHT, GEANY_KEYS_SWITCH_TABLASTUSED, + GEANY_KEYS_NAV_FORWARD, + GEANY_KEYS_NAV_BACK, GEANY_KEYS_EDIT_TOLOWERCASE, GEANY_KEYS_EDIT_TOUPPERCASE,