aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-18 12:34:36 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-18 14:16:23 -0300
commit8b7b71f4742d94cf7a2e5a08e7b2f5a725619476 (patch)
tree05ec646ae8f0bfb6080d160456e4de3038ea9560 /src/nvim/ui.c
parenta0f2961b4fc2beabf1266faef0f543afdffd45f8 (diff)
downloadrneovim-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/ui.c')
-rw-r--r--src/nvim/ui.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 2189021d22..443b50da87 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -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);