diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-05 11:08:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 11:08:52 +0800 |
commit | 18e62c1bdbbb6b93bfb74d974bc511fc4c03748e (patch) | |
tree | 4643f88df3693b8eb5fe9ecd9e40a4b78fc435ec /test/functional | |
parent | 1ed6b9cd2c04bf015b7e053ee5ea778634141b35 (diff) | |
download | rneovim-18e62c1bdbbb6b93bfb74d974bc511fc4c03748e.tar.gz rneovim-18e62c1bdbbb6b93bfb74d974bc511fc4c03748e.tar.bz2 rneovim-18e62c1bdbbb6b93bfb74d974bc511fc4c03748e.zip |
perf(redraw): only redraw Visual area when cursor has moved (#27340)
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index a4c024b526..fd8a06d898 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -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 = [[ |