mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 01:09:56 +10:00
perf(redraw): only redraw Visual area when cursor has moved (#27340)
This commit is contained in:
@@ -39,6 +39,7 @@ describe('decorations providers', function()
|
||||
[16] = {special = Screen.colors.Red, undercurl = true},
|
||||
[17] = {foreground = Screen.colors.Red},
|
||||
[18] = {bold = true, foreground = Screen.colors.SeaGreen};
|
||||
[19] = {bold = true};
|
||||
}
|
||||
end)
|
||||
|
||||
@@ -738,6 +739,25 @@ describe('decorations providers', function()
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
|
||||
it('is not invoked repeatedly in Visual mode with vim.schedule() #20235', function()
|
||||
exec_lua([[_G.cnt = 0]])
|
||||
setup_provider([[
|
||||
function on_do(event, ...)
|
||||
if event == 'win' then
|
||||
vim.schedule(function() end)
|
||||
_G.cnt = _G.cnt + 1
|
||||
end
|
||||
end
|
||||
]])
|
||||
feed('v')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*6
|
||||
{19:-- VISUAL --} |
|
||||
]])
|
||||
eq(2, exec_lua([[return _G.cnt]]))
|
||||
end)
|
||||
end)
|
||||
|
||||
local example_text = [[
|
||||
|
||||
Reference in New Issue
Block a user