mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
perf(ui): avoid ui_flush() work in headless mode
This commit is contained in:
@@ -503,6 +503,9 @@ handle_T ui_cursor_grid(void)
|
|||||||
|
|
||||||
void ui_flush(void)
|
void ui_flush(void)
|
||||||
{
|
{
|
||||||
|
if (!ui_active()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
cmdline_ui_flush();
|
cmdline_ui_flush();
|
||||||
win_ui_flush();
|
win_ui_flush();
|
||||||
msg_ext_ui_flush();
|
msg_ext_ui_flush();
|
||||||
|
@@ -51,7 +51,7 @@ describe('UI receives option updates', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('on attach #11372', function()
|
it('on attach #11372', function()
|
||||||
clear()
|
clear{args_rm={'--headless'}}
|
||||||
local evs = {}
|
local evs = {}
|
||||||
screen = Screen.new(20,5)
|
screen = Screen.new(20,5)
|
||||||
-- Override mouse_on/mouse_off handlers.
|
-- Override mouse_on/mouse_off handlers.
|
||||||
@@ -88,6 +88,13 @@ describe('UI receives option updates', function()
|
|||||||
eq(expected, screen.options)
|
eq(expected, screen.options)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
command("set pumblend=50")
|
||||||
|
expected.pumblend = 50
|
||||||
|
screen:expect(function()
|
||||||
|
eq(expected, screen.options)
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- check handling of out-of-bounds value
|
||||||
command("set pumblend=-1")
|
command("set pumblend=-1")
|
||||||
expected.pumblend = 0
|
expected.pumblend = 0
|
||||||
screen:expect(function()
|
screen:expect(function()
|
||||||
|
Reference in New Issue
Block a user