aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorGregory Anders <greg@gpanders.com>2025-01-16 18:33:22 -0600
committerGitHub <noreply@github.com>2025-01-16 18:33:22 -0600
commitbf098c12e3078df49fd7dee5ba7c2100a211d4c8 (patch)
tree2a56e786310ebf7d5752c7b8dbc978eff7186b61 /src/nvim/getchar.c
parentfb564ddff0b4ec9dad5afa7548777af1c3044273 (diff)
parent819337a13f73bb9dcd82fd51f81f062bd69ab6db (diff)
downloadrneovim-bf098c12e3078df49fd7dee5ba7c2100a211d4c8.tar.gz
rneovim-bf098c12e3078df49fd7dee5ba7c2100a211d4c8.tar.bz2
rneovim-bf098c12e3078df49fd7dee5ba7c2100a211d4c8.zip
Merge pull request #32038 from gpanders/push-nsrttwwnsqvm
feat(terminal): add support for kitty keyboard protocol
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 6cf4556a9f..6ec84ff543 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1517,12 +1517,10 @@ int merge_modifiers(int c_arg, int *modifiers)
int c = c_arg;
if (*modifiers & MOD_MASK_CTRL) {
- if ((c >= '`' && c <= 0x7f) || (c >= '@' && c <= '_')) {
- if (!(State & MODE_TERMINAL) || !(c == 'I' || c == 'J' || c == 'M' || c == '[')) {
- c &= 0x1f;
- if (c == NUL) {
- c = K_ZERO;
- }
+ if (c >= '@' && c <= 0x7f) {
+ c &= 0x1f;
+ if (c == NUL) {
+ c = K_ZERO;
}
} else if (c == '6') {
// CTRL-6 is equivalent to CTRL-^
@@ -2058,6 +2056,12 @@ static bool at_ins_compl_key(void)
/// @return the length of the replaced bytes, 0 if nothing changed, -1 for error.
static int check_simplify_modifier(int max_offset)
{
+ // We want full modifiers in Terminal mode so that the key can be correctly
+ // encoded
+ if (State & MODE_TERMINAL) {
+ return 0;
+ }
+
for (int offset = 0; offset < max_offset; offset++) {
if (offset + 3 >= typebuf.tb_len) {
break;