• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision42acbd0cb313ae85d83b73c5907f4a7f8d57aacb (tree)
Time2022-11-25 05:30:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 9.0.0943: pretending to go out of Insert mode when Esc is received

Commit: https://github.com/vim/vim/commit/d330e8422d1c4670a241ce8ebde4c37918538dce
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 24 20:23:24 2022 +0000

patch 9.0.0943: pretending to go out of Insert mode when Esc is received
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.

Change Summary

Incremental Difference

diff -r 74055e6215af -r 42acbd0cb313 src/getchar.c
--- a/src/getchar.c Thu Nov 24 21:15:03 2022 +0100
+++ b/src/getchar.c Thu Nov 24 21:30:04 2022 +0100
@@ -3263,12 +3263,14 @@
32633263 * get a character: 3. from the user - handle <Esc> in Insert mode
32643264 */
32653265 /*
3266- * Special case: if we get an <ESC> in insert mode and there
3266+ * Special case: if we get an <ESC> in Insert mode and there
32673267 * are no more characters at once, we pretend to go out of
3268- * insert mode. This prevents the one second delay after
3268+ * Insert mode. This prevents the one second delay after
32693269 * typing an <ESC>. If we get something after all, we may
32703270 * have to redisplay the mode. That the cursor is in the wrong
32713271 * place does not matter.
3272+ * Do not do this if the kitty keyboard protocol is used, every
3273+ * <ESC> is the start of an escape sequence then.
32723274 */
32733275 c = 0;
32743276 new_wcol = curwin->w_wcol;
@@ -3277,6 +3279,7 @@
32773279 && typebuf.tb_len == 1
32783280 && typebuf.tb_buf[typebuf.tb_off] == ESC
32793281 && !no_mapping
3282+ && kitty_protocol_state != KKPS_ENABLED
32803283 && ex_normal_busy == 0
32813284 && typebuf.tb_maplen == 0
32823285 && (State & MODE_INSERT)
diff -r 74055e6215af -r 42acbd0cb313 src/version.c
--- a/src/version.c Thu Nov 24 21:15:03 2022 +0100
+++ b/src/version.c Thu Nov 24 21:30:04 2022 +0100
@@ -696,6 +696,8 @@
696696 static int included_patches[] =
697697 { /* Add new patch number below this line */
698698 /**/
699+ 943,
700+/**/
699701 942,
700702 /**/
701703 941,
Show on old repository browser