aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_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/lua/vim_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/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua8
1 files changed, 0 insertions, 8 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 9fd7184cb0..0578d88e66 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -637,7 +637,6 @@ describe('lua stdlib', function()
matches('big failure\nvery async', remove_trace(eval('v:errmsg')))
local screen = Screen.new(60, 5)
- screen:attach()
screen:expect {
grid = [[
^ |
@@ -1403,7 +1402,6 @@ describe('lua stdlib', function()
end)
local screen = Screen.new(50, 7)
- screen:attach()
exec_lua([[
timer = vim.uv.new_timer()
timer:start(20, 0, function ()
@@ -2130,7 +2128,6 @@ describe('lua stdlib', function()
eq({ 1, 5 }, api.nvim_win_get_cursor(0))
local screen = Screen.new(60, 3)
- screen:attach()
eq(1, eval('v:hlsearch'))
screen:expect {
grid = [[
@@ -3401,7 +3398,6 @@ stack traceback:
it('callback is not invoked recursively #30752', function()
local screen = Screen.new(60, 10)
- screen:attach()
exec_lua([[
vim.on_key(function(key, typed)
vim.api.nvim_echo({
@@ -3779,7 +3775,6 @@ stack traceback:
it('fails in fast callbacks #26122', function()
local screen = Screen.new(80, 10)
- screen:attach()
exec_lua([[
local timer = vim.uv.new_timer()
timer:start(0, 0, function()
@@ -3797,7 +3792,6 @@ stack traceback:
it('vim.notify_once', function()
local screen = Screen.new(60, 5)
- screen:attach()
screen:expect {
grid = [[
^ |
@@ -3994,7 +3988,6 @@ stack traceback:
it('updates ruler if cursor moved', function()
-- Fixed for win_execute in vim-patch:8.1.2124, but should've applied to nvim_win_call too!
local screen = Screen.new(30, 5)
- screen:attach()
exec_lua [[
_G.api = vim.api
vim.opt.ruler = true
@@ -4137,7 +4130,6 @@ stack traceback:
it('vim.lua_omnifunc', function()
local screen = Screen.new(60, 5)
- screen:attach()
command [[ set omnifunc=v:lua.vim.lua_omnifunc ]]
-- Note: the implementation is shared with lua command line completion.