From 7111acdc062ca41b08e893d00170e4a276e36d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 5 Sep 2007 18:55:51 +0000 Subject: [PATCH] Make keybinding for scrolling by one line changeable. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1854 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 2 ++ src/document.c | 2 ++ src/keybindings.c | 10 ++++++++++ src/keybindings.h | 2 ++ 4 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index cb1c1378..a7b024fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2007-09-05 Enrico Tröger * src/document.c: Fix missing syntax colouring when saving new files. + * src/document.c, src/keybindings.c, src/keybindings.h: + Make keybinding for scrolling by one line changeable. 2007-09-05 Nick Treleaven diff --git a/src/document.c b/src/document.c index b15089f1..42310002 100644 --- a/src/document.c +++ b/src/document.c @@ -326,6 +326,8 @@ static void setup_sci_keys(ScintillaObject *sci) sci_clear_cmdkey(sci, 'T' | (SCMOD_CTRL << 16) | (SCMOD_SHIFT << 16)); // line copy sci_clear_cmdkey(sci, 'L' | (SCMOD_CTRL << 16)); // line cut sci_clear_cmdkey(sci, 'L' | (SCMOD_CTRL << 16) | (SCMOD_SHIFT << 16)); // line delete + sci_clear_cmdkey(sci, SCK_UP | (SCMOD_CTRL << 16)); // scroll line up + sci_clear_cmdkey(sci, SCK_DOWN | (SCMOD_CTRL << 16)); // scroll line down if (editor_prefs.use_gtk_word_boundaries) { diff --git a/src/keybindings.c b/src/keybindings.c index 7b879324..61830914 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -311,6 +311,10 @@ void keybindings_init(void) GDK_p, GDK_SHIFT_MASK | GDK_MOD1_MASK, "edit_selectparagraph", _("Select current paragraph")); keys[GEANY_KEYS_EDIT_SCROLLTOLINE] = fill(cb_func_edit, GDK_l, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "edit_scrolltoline", _("Scroll to current line")); + keys[GEANY_KEYS_EDIT_SCROLLLINEUP] = fill(cb_func_edit, + GDK_Up, GDK_CONTROL_MASK, "edit_scrolllineup", _("Scroll up the view by one line")); + keys[GEANY_KEYS_EDIT_SCROLLLINEDOWN] = fill(cb_func_edit, + GDK_Down, GDK_CONTROL_MASK, "edit_scrolllinedown", _("Scroll down the view by one line")); keys[GEANY_KEYS_EDIT_INSERTALTWHITESPACE] = fill(cb_func_edit, 0, 0, "edit_insertwhitespace", _("Insert alternative whitespace")); @@ -1104,6 +1108,12 @@ static void cb_func_edit(guint key_id) case GEANY_KEYS_EDIT_SCROLLTOLINE: editor_scroll_to_line(doc_list[idx].sci, -1, 0.5F); break; + case GEANY_KEYS_EDIT_SCROLLLINEUP: + sci_cmd(doc_list[idx].sci, SCI_LINESCROLLUP); + break; + case GEANY_KEYS_EDIT_SCROLLLINEDOWN: + sci_cmd(doc_list[idx].sci, SCI_LINESCROLLDOWN); + break; case GEANY_KEYS_EDIT_DUPLICATELINE: on_menu_duplicate_line1_activate(NULL, NULL); break; diff --git a/src/keybindings.h b/src/keybindings.h index 6edce7ff..9cdba1da 100644 --- a/src/keybindings.h +++ b/src/keybindings.h @@ -141,6 +141,8 @@ typedef enum GEANY_KEYS_EDIT_SELECTLINE, GEANY_KEYS_EDIT_SELECTPARAGRAPH, GEANY_KEYS_EDIT_SCROLLTOLINE, + GEANY_KEYS_EDIT_SCROLLLINEUP, + GEANY_KEYS_EDIT_SCROLLLINEDOWN, GEANY_KEYS_EDIT_INSERTALTWHITESPACE, GEANY_KEYS_EDIT_AUTOCOMPLETE,