From fd50185492c7c5b042cc81fe1fde882bcff03c1b Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 9 May 2024 18:12:44 +0200 Subject: fix(tui): initialize clear attrs with current terminal background Problem: Invalidated regions that are flushed during startup are cleared with unitialized "clear_attrs", which is perceived as flickering. Solution: Initialize "clear_attrs" with current terminal background color. --- test/functional/terminal/tui_spec.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'test/functional') diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index f2f4f356be..d4628ea626 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -2003,6 +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) + it('argv[0] can be overridden #23953', function() if not exec_lua('return pcall(require, "ffi")') then pending('missing LuaJIT FFI') -- cgit