From e255032c11289605c205b55b07df295e6d402f38 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey
Date: Tue, 12 Dec 2017 14:43:03 -0600 Subject: [PATCH] input: support backtab when Slang and/or --rebindkeypad is used The escape sequence Esc [ Z is backtab on most supported terminals, so make sure convert_sequence() handles it as such. --- src/global.c | 4 +--- src/nano.h | 1 + src/winio.c | 14 +++++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/global.c b/src/global.c index 12c2cbc1..6a580899 100644 --- a/src/global.c +++ b/src/global.c @@ -1147,9 +1147,7 @@ void shortcut_init(void) add_to_sclist(MMAIN, "M-^", 0, do_copy_text, 0); add_to_sclist(MMAIN, "M-}", 0, do_indent, 0); add_to_sclist(MMAIN, "M-{", 0, do_unindent, 0); -#ifdef KEY_BTAB - add_to_sclist(MMAIN, "S-Tab", KEY_BTAB, do_unindent, 0); -#endif + add_to_sclist(MMAIN, "S-Tab", SHIFT_TAB, do_unindent, 0); add_to_sclist(MMAIN, "M-:", 0, record_macro, 0); add_to_sclist(MMAIN, "M-;", 0, run_macro, 0); add_to_sclist(MMAIN, "M-U", 0, do_undo, 0); diff --git a/src/nano.h b/src/nano.h index 7ce36646..1792cb4f 100644 --- a/src/nano.h +++ b/src/nano.h @@ -590,6 +590,7 @@ enum #define SHIFT_END 0x456 #define SHIFT_PAGEUP 0x457 #define SHIFT_PAGEDOWN 0x458 +#define SHIFT_TAB 0x459 #ifdef USE_SLANG #ifdef ENABLE_UTF8 diff --git a/src/winio.c b/src/winio.c index ea067761..b66fee84 100644 --- a/src/winio.c +++ b/src/winio.c @@ -622,11 +622,9 @@ int parse_kbinput(WINDOW *win) #ifndef NANO_TINY /* Is Shift being held? */ if (modifiers & 0x01) { -#ifdef KEY_BTAB /* A shifted