Kaydet (Commit) 82769a04 authored tarafından Nick Treleaven's avatar Nick Treleaven

Set Move Line(s) default keybindings, change Move Tab defaults

This does not affect existing users.

Ctrl-Shift-PageUp   Move document left
Ctrl-Shift-PageDown Move document right

The above shortcuts were aliases for selecting left/rightmost
documents, but those are not necessary as Alt-1/Alt-0 does the same.

Alt-PageUp      Move line(s) up
Alt-PageDown    Move line(s) down

Alt is easier to press than Ctrl-Shift, so is better for moving lines
as this needs more accuracy.
üst 8f280ed8
This diff is collapsed.
......@@ -3158,7 +3158,7 @@ by any custom keybindings with the same keyboard shortcut.
Switching documents
^^^^^^^^^^^^^^^^^^^
There are a few non-configurable bindings to switch between documents,
There are some non-configurable bindings to switch between documents,
listed below. These can also be overridden by custom keybindings.
=============== ==================================
......@@ -3166,10 +3166,10 @@ Key Action
=============== ==================================
Alt-[1-9] Select left-most tab, from 1 to 9.
Alt-0 Select right-most tab.
Ctrl-Shift-PgUp Select left-most tab.
Ctrl-Shift-PgDn Select right-most tab.
=============== ==================================
See also `Notebook tab keybindings`_.
Configurable keybindings
^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -3288,10 +3288,10 @@ Word part completion Tab When the autocompletio
the currently selected item up to the next word
part.
Move line(s) up Move the current line or selected lines up by
Move line(s) up Alt-PageUp Move the current line or selected lines up by
one line.
Move line(s) down Move the current line or selected lines down by
Move line(s) down Alt-PageDown Move the current line or selected lines down by
one line.
=============================== ========================= ==================================================
......@@ -3591,10 +3591,10 @@ Switch to last used document Ctrl-Tab Switches to the previo
used document, 3rd-last, etc. Also known as
Most-Recently-Used documents switching.
Move document left Alt-PageUp Changes the current document with the left hand
Move document left Ctrl-Shift-PageUp Changes the current document with the left hand
one.
Move document right Alt-PageDown Changes the current document with the right hand
Move document right Ctrl-Shift-PageDown Changes the current document with the right hand
one.
Move document first Moves the current document to the first position.
......
......@@ -315,9 +315,9 @@ static void init_default_kb(void)
keybindings_set_item(group, GEANY_KEYS_EDITOR_WORDPARTCOMPLETION, NULL,
GDK_Tab, 0, "edit_wordpartcompletion", _("Word part completion"), NULL);
keybindings_set_item(group, GEANY_KEYS_EDITOR_MOVELINEUP, NULL,
0, 0, "edit_movelineup", _("Move line(s) up"), NULL);
GDK_Page_Up, GDK_MOD1_MASK, "edit_movelineup", _("Move line(s) up"), NULL);
keybindings_set_item(group, GEANY_KEYS_EDITOR_MOVELINEDOWN, NULL,
0, 0, "edit_movelinedown", _("Move line(s) down"), NULL);
GDK_Page_Down, GDK_MOD1_MASK, "edit_movelinedown", _("Move line(s) down"), NULL);
group = keybindings_get_core_group(GEANY_KEY_GROUP_CLIPBOARD);
......@@ -526,9 +526,11 @@ static void init_default_kb(void)
keybindings_set_item(group, GEANY_KEYS_NOTEBOOK_SWITCHTABLASTUSED, cb_func_switch_tablastused,
GDK_Tab, GDK_CONTROL_MASK, "switch_tablastused", _("Switch to last used document"), NULL);
keybindings_set_item(group, GEANY_KEYS_NOTEBOOK_MOVETABLEFT, cb_func_move_tab,
GDK_Page_Up, GDK_MOD1_MASK, "move_tableft", _("Move document left"), NULL);
GDK_Page_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "move_tableft",
_("Move document left"), NULL);
keybindings_set_item(group, GEANY_KEYS_NOTEBOOK_MOVETABRIGHT, cb_func_move_tab,
GDK_Page_Down, GDK_MOD1_MASK, "move_tabright", _("Move document right"), NULL);
GDK_Page_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "move_tabright",
_("Move document right"), NULL);
keybindings_set_item(group, GEANY_KEYS_NOTEBOOK_MOVETABFIRST, cb_func_move_tab,
0, 0, "move_tabfirst", _("Move document first"), NULL);
keybindings_set_item(group, GEANY_KEYS_NOTEBOOK_MOVETABLAST, cb_func_move_tab,
......@@ -969,6 +971,7 @@ static gboolean check_fixed_kb(guint keyval, guint state)
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), page);
return TRUE;
}
/* note: these are now overridden by default with move tab bindings */
if (keyval == GDK_Page_Up || keyval == GDK_Page_Down)
{
/* switch to first or last document */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment