commit e998814bbc2810e7531385a1f7990322397d053c
parent fe6cb6e5164aa724e9a5d1c48c9dd2b707a8a2fe
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 23 Sep 2018 19:57:04 +0200
help: show the keystroke <Ctrl+Shift+Delete> as "Sh-^Del"
And in the bargain always return a fixed code instead of searching for
a keystroke that is bound to 'cutwordleft' (which might fail).
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -1156,6 +1156,7 @@ void shortcut_init(void)
add_to_sclist(MMAIN, "M-U", 0, do_undo, 0);
add_to_sclist(MMAIN, "M-E", 0, do_redo, 0);
add_to_sclist(MMAIN, "M-|", 0, do_cut_prev_word, 0);
+ add_to_sclist(MMAIN, "Sh-^Del", CONTROL_SHIFT_DELETE, do_cut_prev_word, 0);
add_to_sclist(MMAIN, "^Del", CONTROL_DELETE, do_cut_next_word, 0);
#endif
#ifdef ENABLE_WORDCOMPLETION
diff --git a/src/winio.c b/src/winio.c
@@ -542,7 +542,7 @@ int parse_kbinput(WINDOW *win)
return CONTROL_DELETE;
#ifndef NANO_TINY
else if (retval == controlshiftdelete)
- return the_code_for(do_cut_prev_word, KEY_BACKSPACE);
+ return CONTROL_SHIFT_DELETE;
else if (retval == shiftcontrolleft) {
shift_held = TRUE;
return CONTROL_LEFT;
@@ -601,7 +601,7 @@ int parse_kbinput(WINDOW *win)
#endif
/* Are both Shift and Ctrl being held while Delete is pressed? */
if ((modifiers & 0x05) == 0x05 && retval == KEY_DC)
- return the_code_for(do_cut_prev_word, KEY_BACKSPACE);
+ return CONTROL_SHIFT_DELETE;
/* Is Ctrl being held? */
if (modifiers & 0x04) {
if (retval == KEY_UP)