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).
master
Benno Schulenberg 2018-09-23 19:57:04 +02:00
parent fe6cb6e516
commit e998814bbc
2 changed files with 3 additions and 2 deletions

View File

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

View File

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