Added keybinding for Delete from line start to current position

Closes #1134
This commit is contained in:
Abel 'Akronix' Serrano Juste 2016-07-13 01:23:18 +02:00 committed by Matthew Brush
parent fdcf860156
commit 14904a18ff
4 changed files with 11 additions and 0 deletions

View File

@ -3347,6 +3347,9 @@ Delete current line(s) Ctrl-K Deletes the current li
Delete to line end Ctrl-Shift-Delete Deletes from the current caret position to the
end of the current line.
Delete to line start Ctrl-Shift-BackSpace Deletes from the beginning of the line to the
current caret position.
Duplicate line or selection Ctrl-D Duplicates the current line or selection.
Transpose current line Transposes the current line with the previous one.

View File

@ -4815,6 +4815,7 @@ static void setup_sci_keys(ScintillaObject *sci)
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_DELETE | (SCMOD_CTRL << 16) | (SCMOD_SHIFT << 16)); /* line to end delete */
sci_clear_cmdkey(sci, SCK_BACK | (SCMOD_CTRL << 16) | (SCMOD_SHIFT << 16)); /* line to beginning delete */
sci_clear_cmdkey(sci, '/' | (SCMOD_CTRL << 16)); /* Previous word part */
sci_clear_cmdkey(sci, '\\' | (SCMOD_CTRL << 16)); /* Next word part */
sci_clear_cmdkey(sci, SCK_UP | (SCMOD_CTRL << 16)); /* scroll line up */

View File

@ -386,6 +386,9 @@ static void init_default_kb(void)
add_kb(group, GEANY_KEYS_EDITOR_DELETELINETOEND, NULL,
GDK_Delete, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_deletelinetoend",
_("Delete to line end"), NULL);
add_kb(group, GEANY_KEYS_EDITOR_DELETELINETOBEGINNING, NULL,
GDK_BackSpace, GDK_SHIFT_MASK | GEANY_PRIMARY_MOD_MASK, "edit_deletelinetobegin",
_("Delete to beginning of line"), NULL);
/* Note: transpose may fit better in format group, but that would break the API */
add_kb(group, GEANY_KEYS_EDITOR_TRANSPOSELINE, NULL,
0, 0, "edit_transposeline", _("_Transpose Current Line"), NULL);
@ -2134,6 +2137,9 @@ static gboolean cb_func_editor_action(guint key_id)
case GEANY_KEYS_EDITOR_DELETELINETOEND:
sci_send_command(doc->editor->sci, SCI_DELLINERIGHT);
break;
case GEANY_KEYS_EDITOR_DELETELINETOBEGINNING:
sci_send_command(doc->editor->sci, SCI_DELLINELEFT);
break;
case GEANY_KEYS_EDITOR_TRANSPOSELINE:
sci_send_command(doc->editor->sci, SCI_LINETRANSPOSE);
break;

View File

@ -185,6 +185,7 @@ enum GeanyKeyBindingID
GEANY_KEYS_GOTO_TAGDEFINITION, /**< Keybinding. */
GEANY_KEYS_SEARCH_NEXTMESSAGE, /**< Keybinding. */
GEANY_KEYS_EDITOR_DELETELINETOEND, /**< Keybinding. */
GEANY_KEYS_EDITOR_DELETELINETOBEGINNING, /**< Keybinding. */
GEANY_KEYS_FORMAT_AUTOINDENT, /**< Keybinding. */
GEANY_KEYS_FILE_OPENSELECTED, /**< Keybinding. */
GEANY_KEYS_GOTO_BACK, /**< Keybinding. */