diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-09-06 07:25:01 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-06 07:25:01 +0200 | 
| commit | 51808a244ecaa0a40b4e8280938333d2792d8422 (patch) | |
| tree | 722b303136a2dec83f3f4f14ee0b5d3aa62fa559 /src/nvim/state.c | |
| parent | 82795c2c3a429b2725af882cad4317bed8f1b741 (diff) | |
| parent | b9d6bda53126433cbb251b47d8788d92cda9e6e4 (diff) | |
| download | rneovim-51808a244ecaa0a40b4e8280938333d2792d8422.tar.gz rneovim-51808a244ecaa0a40b4e8280938333d2792d8422.tar.bz2 rneovim-51808a244ecaa0a40b4e8280938333d2792d8422.zip  | |
Merge #7221 from justinmk/ev-focusgained
tui: schedule event instead of <FocusGained> pseudokey
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) {  | 
