diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-18 12:34:36 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-18 14:16:23 -0300 |
commit | 8b7b71f4742d94cf7a2e5a08e7b2f5a725619476 (patch) | |
tree | 05ec646ae8f0bfb6080d160456e4de3038ea9560 /src/nvim/getchar.c | |
parent | a0f2961b4fc2beabf1266faef0f543afdffd45f8 (diff) | |
download | rneovim-8b7b71f4742d94cf7a2e5a08e7b2f5a725619476.tar.gz rneovim-8b7b71f4742d94cf7a2e5a08e7b2f5a725619476.tar.bz2 rneovim-8b7b71f4742d94cf7a2e5a08e7b2f5a725619476.zip |
ui: Refactor so that busy state won't be the default
Even though assuming nvim is busy most times is simpler, it has a problem: A lot
of unnecessary busy_start/busy_stop notifications are sent to the UI. That's
because in the majority of scenarios almost no time is spent between
`event_poll` calls.
This restores the normal behavior which is to call busy_start only when nvim is
going to perform some task that can take a significant amount of time. Also
improve the usage of buffering in the TUI when changing the cursor state.
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 41b3d9dda8..96ce586a9e 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2379,6 +2379,11 @@ inchar ( int retesc = FALSE; /* return ESC with gotint */ int script_char; + if (wait_time == -1L || wait_time > 100L) { + // flush output before waiting + ui_flush(); + } + /* * Don't reset these when at the hit-return prompt, otherwise an endless * recursive loop may result (write error in swapfile, hit-return, timeout |