From e62beab71972bd30a56fe48766d8eb5e691c5cad Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 3 Jul 2020 23:02:02 -0400 Subject: [PATCH] Understand Escape as another name for Esc This allows us to remove special-case handling of Esc in forward_modified_utf8(), which was always sending "" to nvim even when there were modifiers present. Closes #12584 --- src/nvim/keymap.c | 1 + src/nvim/tui/input.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index 2b6f022d9d..b53a0d3e0b 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -156,6 +156,7 @@ static const struct key_name_entry { { K_BS, "BS" }, { K_BS, "BackSpace" }, // Alternative name { ESC, "Esc" }, + { ESC, "Escape" }, // Alternative name { CSI, "CSI" }, { K_CSI, "xCSI" }, { '|', "Bar" }, diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index bbee7e4712..cc04920b32 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -198,9 +198,6 @@ static void forward_modified_utf8(TermInput *input, TermKeyKey *key) char buf[64]; if (key->type == TERMKEY_TYPE_KEYSYM - && key->code.sym == TERMKEY_SYM_ESCAPE) { - len = (size_t)snprintf(buf, sizeof(buf), ""); - } else if (key->type == TERMKEY_TYPE_KEYSYM && key->code.sym == TERMKEY_SYM_SUSPEND) { len = (size_t)snprintf(buf, sizeof(buf), ""); } else {