mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user