summaryrefslogtreecommitdiff
path: root/src/keys.cc
diff options
context:
space:
mode:
authorTim Allen <screwtape@froup.com>2020-10-31 00:43:34 +1100
committerTim Allen <screwtape@froup.com>2020-10-31 01:20:49 +1100
commitc039879c82544e1c0bfb75b197ff76e6d73cd10a (patch)
treef2ed2a9e8438f7be0230ce420e3b15e2e25dca45 /src/keys.cc
parent90043e7df04359ec9ef629fa46fc6a524673be84 (diff)
src/ncurses_ui.cc: Teach Kakoune about ctrl-symbol keys.
Previously, Kakoune only handled ctrl-codes less than 27, representing them as lower-case ASCII codes. For regular keys like <c-a>, that worked fine. However, NUL became the unorthodox <c-`> and other ctrl-symbols (<c-\>, <c-]>, <c-_>) weren't supported at all. Now NUL is rendered as the more comfortable <c-space>, and the other ctrl-symbol codes are properly decoded. Fixes #2553.
Diffstat (limited to 'src/keys.cc')
-rw-r--r--src/keys.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/keys.cc b/src/keys.cc
index 29fa9ce1..b6761584 100644
--- a/src/keys.cc
+++ b/src/keys.cc
@@ -229,6 +229,10 @@ UnitTest test_keys{[]()
alt('j'),
ctrl('r'),
shift(Key::Up),
+ ctrl('['),
+ ctrl('\\'),
+ ctrl(']'),
+ ctrl('_'),
};
String keys_as_str;
for (auto& key : keys)