aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-11-11 22:15:19 +0100
committerbfredl <bjorn.linse@gmail.com>2024-11-14 12:40:57 +0100
commite61228a214ebda9845db9462dad0a8c362d3963f (patch)
treefc5908c85c0cc6affc3bc325cd75f6efaeea95d8 /test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
parent40dee8a2dcba996badaa6182eb34fde1694f92a3 (diff)
downloadrneovim-e61228a214ebda9845db9462dad0a8c362d3963f.tar.gz
rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.tar.bz2
rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.zip
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.
Diffstat (limited to 'test/functional/ex_cmds/swapfile_preserve_recover_spec.lua')
-rw-r--r--test/functional/ex_cmds/swapfile_preserve_recover_spec.lua4
1 files changed, 0 insertions, 4 deletions
diff --git a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
index 5bb2a0181e..2820cc9663 100644
--- a/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
+++ b/test/functional/ex_cmds/swapfile_preserve_recover_spec.lua
@@ -114,7 +114,6 @@ describe("preserve and (R)ecover with custom 'directory'", function()
it('killing TUI process without :preserve #22096', function()
t.skip(t.is_os('win'))
local screen0 = Screen.new()
- screen0:attach()
local child_server = new_pipename()
fn.termopen({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--listen', child_server }, {
env = { VIMRUNTIME = os.getenv('VIMRUNTIME') },
@@ -171,7 +170,6 @@ describe('swapfile detection', function()
local nvim2 = spawn({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--embed' }, true, nil, true)
set_session(nvim2)
local screen2 = Screen.new(256, 40)
- screen2:attach()
screen2._default_attr_ids = nil
exec(init)
command('autocmd! nvim_swapfile') -- Delete the default handler (which skips the dialog).
@@ -254,7 +252,6 @@ describe('swapfile detection', function()
local nvim1 = spawn(new_argv(), true, nil, true)
set_session(nvim1)
local screen = Screen.new(75, 18)
- screen:attach()
exec(init)
feed(':edit Xfile1\n')
@@ -325,7 +322,6 @@ describe('swapfile detection', function()
[1] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg
[2] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg
})
- screen:attach()
exec(init)
if not swapexists then