diff options
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r-- | src/nvim/state.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index 900eac0826..d6a037ffd6 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -26,10 +26,13 @@ #include "nvim/ui.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "state.c.generated.h" // IWYU pragma: export +# include "state.c.generated.h" #endif +size_t hack_keyfix = 0; + void state_enter(VimState *s) + FUNC_ATTR_NONNULL_ALL { while (true) { int check_result = s->check ? s->check(s) : 1; @@ -81,6 +84,18 @@ getkey: } } + // Hacky "fix" for https://github.com/neovim/neovim/issues/20726 + if (key == 3) { + hack_keyfix ++; + if (hack_keyfix == 100) { + got_int = 0; + hack_keyfix = 0; + goto getkey; + } + } else { + hack_keyfix = 0; + } + if (key == K_EVENT) { // An event handler may use the value of reg_executing. // Clear it if it should be cleared when getting the next character. @@ -168,6 +183,7 @@ int get_real_state(void) /// The first character represents the major mode, the following ones the minor /// ones. void get_mode(char *buf) + FUNC_ATTR_NONNULL_ALL { int i = 0; |