diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-21 11:11:02 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-08-21 14:16:16 +0800 |
commit | 4956f267449ca7526145c63ef095bfd731174635 (patch) | |
tree | 5933bdab52411f2905002f2566559725807a62b9 /src/nvim/getchar.c | |
parent | ab45d5bf6d46abd9b29389dee6689044fd63e225 (diff) | |
download | rneovim-4956f267449ca7526145c63ef095bfd731174635.tar.gz rneovim-4956f267449ca7526145c63ef095bfd731174635.tar.bz2 rneovim-4956f267449ca7526145c63ef095bfd731174635.zip |
vim-patch:8.1.2046: SafeState may be triggered at the wrong moment
Problem: SafeState may be triggered at the wrong moment.
Solution: Move it up higher to after where messages are processed. Add a
SafeStateAgain event to tigger there.
https://github.com/vim/vim/commit/69198cb8c08f124729c41a4681f2d142228a9139
SafeStateAgain is N/A.
Move SafeState functions to state.c.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 2e584e7cff..957f13b1da 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -885,6 +885,7 @@ int ins_typebuf(char *str, int noremap, int offset, bool nottyped, bool silent) if (++typebuf.tb_change_cnt == 0) { typebuf.tb_change_cnt = 1; } + state_no_longer_safe(); addlen = (int)strlen(str); @@ -1625,6 +1626,12 @@ int vgetc(void) // Execute Lua on_key callbacks. nlua_execute_on_key(c); + // Need to process the character before we know it's safe to do something + // else. + if (c != K_IGNORE) { + state_no_longer_safe(); + } + return c; } |