Add keybindings for forward/back code navigation.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1593 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2007-06-03 16:03:46 +00:00
parent b064e5da46
commit a42f1f93c5
4 changed files with 42 additions and 1 deletions

View File

@ -1,3 +1,18 @@
2007-06-03 Enrico Tröger <enrico.troeger@uvena.de>
* doc/geany.docbook, src/keybindings.c, src/keybindings.h:
Add keybindings for forward/back code navigation.
2007-06-02 Enrico Tröger <enrico.troeger@uvena.de>
* 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 <enrico.troeger@uvena.de>
* src/templates.c: Add Haskell to make_comment_block().

View File

@ -1728,6 +1728,14 @@ widget "GeanyPrefsDialog" style "geanyStyle"
<entry>Switch to last used document</entry>
<entry>Switches to the previously selected open document.</entry>
</row>
<row>
<entry>Navigate forward a location</entry>
<entry>Switches to the next location in the navigation history.</entry>
</row>
<row>
<entry>Navigate back a location</entry>
<entry>Switches to the previous location in the navigation history.</entry>
</row>
<row>
<entry align="left" spanname="hspan">Editing operations</entry>
</row>

View File

@ -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();
}

View File

@ -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,