diff options
author | ckelsel <ckelsel@hotmail.com> | 2017-09-10 16:43:01 +0800 |
---|---|---|
committer | ckelsel <ckelsel@hotmail.com> | 2017-09-10 16:43:01 +0800 |
commit | af2dd6827299070d81218e9ba54646bfaf53607c (patch) | |
tree | 56345be9219a808efc0f34304f8e873b866a357c /src/nvim/state.c | |
parent | 70c62d58d53f8d7d213e025f3f432e6521be8680 (diff) | |
parent | d173d48177fd55928a9acd64a06d47371bbb6b09 (diff) | |
download | rneovim-af2dd6827299070d81218e9ba54646bfaf53607c.tar.gz rneovim-af2dd6827299070d81218e9ba54646bfaf53607c.tar.bz2 rneovim-af2dd6827299070d81218e9ba54646bfaf53607c.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r-- | src/nvim/state.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index eb0b590a9b..4d9032b7a5 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -26,10 +26,11 @@ void state_enter(VimState *s) int check_result = s->check ? s->check(s) : 1; if (!check_result) { - break; + break; // Terminate this state. } else if (check_result == -1) { - continue; + continue; // check() again. } + // Execute this state. int key; @@ -48,11 +49,13 @@ getkey: ui_flush(); // 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. If an event was put into the queue, we send K_EVENT - // directly. + // mapping engine. (void)os_inchar(NULL, 0, -1, 0); input_disable_events(); - key = !multiqueue_empty(main_loop.events) ? K_EVENT : safe_vgetc(); + // If an event was put into the queue, we send K_EVENT directly. + key = !multiqueue_empty(main_loop.events) + ? K_EVENT + : safe_vgetc(); } if (key == K_EVENT) { |