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.
This commit is contained in:
Thiago de Arruda
2015-03-18 12:34:36 -03:00
parent a0f2961b4f
commit 8b7b71f474
8 changed files with 32 additions and 33 deletions

View File

@@ -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