aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-05 12:19:36 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-25 18:57:35 -0300
commit05d60c4812f1981f2d03991e33ed54aa2cca3ed6 (patch)
tree61340b80372839aed8cdb1b5a07ec17f2d20bb5c
parent51c69b89a7143d43024049a135573883fc10f6b0 (diff)
downloadrneovim-05d60c4812f1981f2d03991e33ed54aa2cca3ed6.tar.gz
rneovim-05d60c4812f1981f2d03991e33ed54aa2cca3ed6.tar.bz2
rneovim-05d60c4812f1981f2d03991e33ed54aa2cca3ed6.zip
ui: Schedule screen refreshs to run in the event loop
This is required to avoid event loop recursion due to indirect calls to os_breakcheck by screenalloc
-rw-r--r--src/nvim/ui.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 443b50da87..e22ef6692d 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -23,6 +23,7 @@
#include "nvim/normal.h"
#include "nvim/option.h"
#include "nvim/os_unix.h"
+#include "nvim/os/event.h"
#include "nvim/os/time.h"
#include "nvim/os/input.h"
#include "nvim/os/signal.h"
@@ -208,10 +209,8 @@ void ui_detach(UI *ui)
}
ui_count--;
-
- if (ui_count) {
- ui_refresh();
- }
+ // schedule a refresh
+ event_push((Event) { .handler = refresh }, false);
}
void ui_clear(void)
@@ -486,3 +485,10 @@ static void ui_change_mode(void)
conceal_check_cursur_line();
}
+static void refresh(Event event)
+{
+ if (ui_count) {
+ ui_refresh();
+ }
+}
+