mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
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:
@@ -45,7 +45,7 @@ static struct {
|
||||
} sr;
|
||||
static int current_attr_code = 0;
|
||||
static bool pending_cursor_update = false;
|
||||
static int busy = 1;
|
||||
static int busy = 0;
|
||||
static int height, width;
|
||||
|
||||
// This set of macros allow us to use UI_CALL to invoke any function on
|
||||
@@ -155,7 +155,6 @@ void ui_busy_start(void)
|
||||
{
|
||||
if (!(busy++)) {
|
||||
UI_CALL(busy_start);
|
||||
ui_flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,11 +162,9 @@ void ui_busy_stop(void)
|
||||
{
|
||||
if (!(--busy)) {
|
||||
UI_CALL(busy_stop);
|
||||
ui_flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ui_mouse_on(void)
|
||||
{
|
||||
UI_CALL(mouse_on);
|
||||
|
Reference in New Issue
Block a user