commit fb8d981bfa642eece91a46e11875daa19e57c20e
parent 915064870f6fd65e425c75ae9baf634b5031c88d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 5 Oct 2018 19:09:17 +0200
tweaks: exclude word-deletion keystrokes from the tiny version
Because word deletion is not available there.
Diffstat:
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2576,9 +2576,9 @@ int main(int argc, char **argv)
/* Ask for the codes for Control+Home/End. */
controlhome = get_keycode("kHOM5", CONTROL_HOME);
controlend = get_keycode("kEND5", CONTROL_END);
+#ifndef NANO_TINY
controldelete = get_keycode("kDC5", CONTROL_DELETE);
controlshiftdelete = get_keycode("kDC6", CONTROL_SHIFT_DELETE);
-#ifndef NANO_TINY
/* Ask for the codes for Shift+Control+Left/Right/Up/Down. */
shiftcontrolleft = get_keycode("kLFT6", SHIFT_CONTROL_LEFT);
shiftcontrolright = get_keycode("kRIT6", SHIFT_CONTROL_RIGHT);
diff --git a/src/proto.h b/src/proto.h
@@ -61,9 +61,9 @@ extern int controlup;
extern int controldown;
extern int controlhome;
extern int controlend;
+#ifndef NANO_TINY
extern int controldelete;
extern int controlshiftdelete;
-#ifndef NANO_TINY
extern int shiftcontrolleft;
extern int shiftcontrolright;
extern int shiftcontrolup;
diff --git a/src/proto.h.gch b/src/proto.h.gch
Binary files differ.
diff --git a/src/winio.c b/src/winio.c
@@ -538,9 +538,9 @@ int parse_kbinput(WINDOW *win)
return CONTROL_HOME;
else if (retval == controlend)
return CONTROL_END;
+#ifndef NANO_TINY
else if (retval == controldelete)
return CONTROL_DELETE;
-#ifndef NANO_TINY
else if (retval == controlshiftdelete)
return CONTROL_SHIFT_DELETE;
else if (retval == shiftcontrolleft) {
@@ -1093,6 +1093,7 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
* Linux console/xterm/Terminal. */
if (length > 2 && seq[2] == '~')
return KEY_DC;
+#ifndef NANO_TINY
if (length > 4 && seq[2] == ';' && seq[4] == '~') {
*consumed = 5;
if (seq[3] == '5')
@@ -1108,6 +1109,7 @@ int convert_sequence(const int *seq, size_t length, int *consumed)
if (length > 2 && seq[2] == '@')
/* Esc [ 3 @ == Ctrl-Shift-Delete on urxvt. */
return controlshiftdelete;
+#endif
break;
case '4': /* Esc [ 4 ~ == End on VT220/VT320/
* Linux console/xterm. */