aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2024-05-26 19:54:08 +0200
committerGitHub <noreply@github.com>2024-05-26 10:54:08 -0700
commitbc63ffcf39e8ad6c0925c0ad8503bfb3ed8497f3 (patch)
treeebd8cf7a5095ea477201f399e641d956236cd75c /test
parenteb37241d38ad35b9e6bfac6379dd10e60aa0350c (diff)
downloadrneovim-bc63ffcf39e8ad6c0925c0ad8503bfb3ed8497f3.tar.gz
rneovim-bc63ffcf39e8ad6c0925c0ad8503bfb3ed8497f3.tar.bz2
rneovim-bc63ffcf39e8ad6c0925c0ad8503bfb3ed8497f3.zip
fix(tui): reset clear_region attributes during startup #28713
Problem: Fix added in #28676 worked accidentally(used variables were themselves uninitialized at this point during startup) and does not always work. Solution: Reset attributes when clearing regions during startup.
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/tui_spec.lua65
1 files changed, 33 insertions, 32 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index d4628ea626..efa65b7441 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -2003,38 +2003,39 @@ describe('TUI', function()
]])
end)
- it('invalidated regions are cleared with terminal background attr', function()
- local screen = Screen.new(50, 10)
- screen:set_default_attr_ids({ [1] = { foreground = Screen.colors.Black } })
- screen:attach()
- fn.termopen({
- nvim_prog,
- '--clean',
- '--cmd',
- 'set termguicolors',
- '--cmd',
- 'sleep 10',
- }, {
- env = {
- VIMRUNTIME = os.getenv('VIMRUNTIME'),
- },
- })
- screen:expect({
- grid = [[
- {1:^ }|
- {1: }|*8
- |
- ]],
- })
- screen:try_resize(51, 11)
- screen:expect({
- grid = [[
- {1:^ }|
- {1: }|*9
- |
- ]],
- })
- end)
+ -- #28667, #28668
+ for _, guicolors in ipairs({ 'notermguicolors', 'termguicolors' }) do
+ it('has no black flicker when clearing regions during startup with ' .. guicolors, function()
+ local screen = Screen.new(50, 10)
+ screen:attach()
+ fn.termopen({
+ nvim_prog,
+ '--clean',
+ '--cmd',
+ 'set ' .. guicolors,
+ '--cmd',
+ 'sleep 10',
+ }, {
+ env = {
+ VIMRUNTIME = os.getenv('VIMRUNTIME'),
+ },
+ })
+ screen:expect({
+ grid = [[
+ ^ |
+ |*9
+ ]],
+ intermediate = true,
+ })
+ screen:try_resize(51, 11)
+ screen:expect({
+ grid = [[
+ ^ |
+ |*10
+ ]],
+ })
+ end)
+ end
it('argv[0] can be overridden #23953', function()
if not exec_lua('return pcall(require, "ffi")') then