summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-24 20:23:24 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-24 20:23:24 +0000
commitd330e8422d1c4670a241ce8ebde4c37918538dce (patch)
tree544c23aef861787874c3a50b91ef27561edeef8a
parentf60bdc3417a56a1f69e001a7ec210b92d5b0f2e1 (diff)
downloadvim-git-d330e8422d1c4670a241ce8ebde4c37918538dce.tar.gz
patch 9.0.0943: pretending to go out of Insert mode when Esc is receivedv9.0.0943
Problem: Pretending to go out of Insert mode when Esc is received has side effects. Solution: When the kitty keyboard protocol is enabled expect Esc to always be the start of an escape sequence.
-rw-r--r--src/getchar.c7
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/getchar.c b/src/getchar.c
index fab721b6d..1e03b86c3 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3263,12 +3263,14 @@ vgetorpeek(int advance)
* get a character: 3. from the user - handle <Esc> in Insert mode
*/
/*
- * Special case: if we get an <ESC> in insert mode and there
+ * Special case: if we get an <ESC> in Insert mode and there
* are no more characters at once, we pretend to go out of
- * insert mode. This prevents the one second delay after
+ * Insert mode. This prevents the one second delay after
* typing an <ESC>. If we get something after all, we may
* have to redisplay the mode. That the cursor is in the wrong
* place does not matter.
+ * Do not do this if the kitty keyboard protocol is used, every
+ * <ESC> is the start of an escape sequence then.
*/
c = 0;
new_wcol = curwin->w_wcol;
@@ -3277,6 +3279,7 @@ vgetorpeek(int advance)
&& typebuf.tb_len == 1
&& typebuf.tb_buf[typebuf.tb_off] == ESC
&& !no_mapping
+ && kitty_protocol_state != KKPS_ENABLED
&& ex_normal_busy == 0
&& typebuf.tb_maplen == 0
&& (State & MODE_INSERT)
diff --git a/src/version.c b/src/version.c
index d86bf0abb..f602fe347 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 943,
+/**/
942,
/**/
941,