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/normal.h"
|
||||||
#include "nvim/option.h"
|
#include "nvim/option.h"
|
||||||
#include "nvim/os_unix.h"
|
#include "nvim/os_unix.h"
|
||||||
|
#include "nvim/os/event.h"
|
||||||
#include "nvim/os/time.h"
|
#include "nvim/os/time.h"
|
||||||
#include "nvim/os/input.h"
|
#include "nvim/os/input.h"
|
||||||
#include "nvim/os/signal.h"
|
#include "nvim/os/signal.h"
|
||||||
@@ -208,10 +209,8 @@ void ui_detach(UI *ui)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui_count--;
|
ui_count--;
|
||||||
|
// schedule a refresh
|
||||||
if (ui_count) {
|
event_push((Event) { .handler = refresh }, false);
|
||||||
ui_refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_clear(void)
|
void ui_clear(void)
|
||||||
@@ -486,3 +485,10 @@ static void ui_change_mode(void)
|
|||||||
conceal_check_cursur_line();
|
conceal_check_cursur_line();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void refresh(Event event)
|
||||||
|
{
|
||||||
|
if (ui_count) {
|
||||||
|
ui_refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user