aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-28 07:19:03 +0800
committerGitHub <noreply@github.com>2023-02-28 07:19:03 +0800
commit2630341db65772e0a636c2a1cfbd6bba8ca9b28d (patch)
tree2ffeb0efc6bead3304fa0b3229a70ec0449e3a03 /test/functional
parentfb2ead6cf3ef2d5a60af5dbe9cd1443a07296beb (diff)
downloadrneovim-2630341db65772e0a636c2a1cfbd6bba8ca9b28d.tar.gz
rneovim-2630341db65772e0a636c2a1cfbd6bba8ca9b28d.tar.bz2
rneovim-2630341db65772e0a636c2a1cfbd6bba8ca9b28d.zip
fix(tui): avoid stack-use-after-scope with cursor color (#22435)
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/terminal/tui_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 792ad63e76..bbcf5ecad7 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -1512,6 +1512,42 @@ describe('TUI', function()
exec_lua([[vim.loop.kill(vim.fn.jobpid(vim.bo.channel), 'sigterm')]])
screen:expect({any = '%[Process exited 1%]'})
end)
+
+ it('no stack-use-after-scope with cursor color #22432', function()
+ screen:set_option('rgb', true)
+ command('set termguicolors')
+ child_session:request('nvim_exec', [[
+ set tgc
+ hi Cursor guifg=Red guibg=Green
+ set guicursor=n:block-Cursor/lCursor
+ ]], false)
+ screen:set_default_attr_ids({
+ [1] = {reverse = true},
+ [2] = {bold = true, foreground = Screen.colors.Blue},
+ [3] = {foreground = Screen.colors.Blue},
+ [4] = {reverse = true, bold = true},
+ [5] = {bold = true},
+ })
+ screen:expect([[
+ {1: } |
+ {2:~}{3: }|
+ {2:~}{3: }|
+ {2:~}{3: }|
+ {4:[No Name] }|
+ |
+ {5:-- TERMINAL --} |
+ ]])
+ feed('i')
+ screen:expect([[
+ {1: } |
+ {2:~}{3: }|
+ {2:~}{3: }|
+ {2:~}{3: }|
+ {4:[No Name] }|
+ {5:-- INSERT --} |
+ {5:-- TERMINAL --} |
+ ]])
+ end)
end)
describe('TUI', function()