From abe6a07c54c0e927cf43f7f61b05ac91547daeed Mon Sep 17 00:00:00 2001 From: bfredl Date: Fri, 8 Nov 2024 11:45:55 +0100 Subject: refactor(tests): continue the global highlight definition work --- test/functional/vimscript/timer_spec.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'test/functional/vimscript/timer_spec.lua') diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua index f075e382bc..1e484c9ff9 100644 --- a/test/functional/vimscript/timer_spec.lua +++ b/test/functional/vimscript/timer_spec.lua @@ -109,9 +109,6 @@ describe('timers', function() it('can invoke redraw in blocking getchar() call', function() local screen = Screen.new(40, 6) screen:attach() - screen:set_default_attr_ids({ - [1] = { bold = true, foreground = Screen.colors.Blue }, - }) api.nvim_buf_set_lines(0, 0, -1, true, { 'ITEM 1', 'ITEM 2' }) source([[ @@ -229,7 +226,6 @@ describe('timers', function() it("doesn't mess up the cmdline", function() local screen = Screen.new(40, 6) screen:attach() - screen:set_default_attr_ids({ [0] = { bold = true, foreground = 255 } }) source([[ let g:val = 0 func! MyHandler(timer) @@ -247,7 +243,7 @@ describe('timers', function() feed(':good') screen:expect([[ | - {0:~ }|*4 + {1:~ }|*4 :good^ | ]]) command('let g:val = 1') -- cgit From e61228a214ebda9845db9462dad0a8c362d3963f Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 11 Nov 2024 22:15:19 +0100 Subject: fix(tests): needing two calls to setup a screen is cringe Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session. --- test/functional/vimscript/timer_spec.lua | 3 --- 1 file changed, 3 deletions(-) (limited to 'test/functional/vimscript/timer_spec.lua') diff --git a/test/functional/vimscript/timer_spec.lua b/test/functional/vimscript/timer_spec.lua index 1e484c9ff9..d1b8bfe5d9 100644 --- a/test/functional/vimscript/timer_spec.lua +++ b/test/functional/vimscript/timer_spec.lua @@ -108,7 +108,6 @@ describe('timers', function() it('can invoke redraw in blocking getchar() call', function() local screen = Screen.new(40, 6) - screen:attach() api.nvim_buf_set_lines(0, 0, -1, true, { 'ITEM 1', 'ITEM 2' }) source([[ @@ -225,7 +224,6 @@ describe('timers', function() it("doesn't mess up the cmdline", function() local screen = Screen.new(40, 6) - screen:attach() source([[ let g:val = 0 func! MyHandler(timer) @@ -263,7 +261,6 @@ describe('timers', function() it('can be triggered after an empty string mapping #17257', function() local screen = Screen.new(40, 6) - screen:attach() command([=[imap [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=]) feed('i') screen:expect({ any = 'E605: Exception not caught: x' }) -- cgit