diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 14:57:57 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 14:57:57 -0700 |
commit | c324271b99eee4c621463f368914d57cd729bd9c (patch) | |
tree | 5d979d333a2d5f9c080991d5482fd5916f8579c6 /src/nvim/state.c | |
parent | 931bffbda3668ddc609fc1da8f9eb576b170aa52 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-c324271b99eee4c621463f368914d57cd729bd9c.tar.gz rneovim-c324271b99eee4c621463f368914d57cd729bd9c.tar.bz2 rneovim-c324271b99eee4c621463f368914d57cd729bd9c.zip |
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r-- | src/nvim/state.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index 900eac0826..0df060ecf4 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -3,10 +3,14 @@ #include "nvim/ascii_defs.h" #include "nvim/autocmd.h" +#include "nvim/autocmd_defs.h" +#include "nvim/buffer_defs.h" #include "nvim/drawscreen.h" #include "nvim/eval.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/event/defs.h" +#include "nvim/event/loop.h" #include "nvim/event/multiqueue.h" #include "nvim/ex_getln.h" #include "nvim/getchar.h" @@ -26,10 +30,11 @@ #include "nvim/ui.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "state.c.generated.h" // IWYU pragma: export +# include "state.c.generated.h" #endif void state_enter(VimState *s) + FUNC_ATTR_NONNULL_ALL { while (true) { int check_result = s->check ? s->check(s) : 1; @@ -72,9 +77,9 @@ getkey: // Call `os_inchar` directly to block for events or user input without // consuming anything from `input_buffer`(os/input.c) or calling the // mapping engine. - (void)os_inchar(NULL, 0, -1, typebuf.tb_change_cnt, main_loop.events); + os_inchar(NULL, 0, -1, typebuf.tb_change_cnt, main_loop.events); // If an event was put into the queue, we send K_EVENT directly. - if (!multiqueue_empty(main_loop.events)) { + if (!input_available() && !multiqueue_empty(main_loop.events)) { key = K_EVENT; } else { goto getkey; @@ -168,6 +173,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; |