mirror of
https://github.com/neovim/neovim.git
synced 2026-01-04 02:17:09 +10:00
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.
This commit is contained in:
@@ -41,7 +41,6 @@ describe('vim.ui_attach', function()
|
||||
[6] = { reverse = true, bold = true },
|
||||
[7] = { background = Screen.colors.Yellow1 },
|
||||
})
|
||||
screen:attach()
|
||||
end)
|
||||
|
||||
local function expect_events(expected)
|
||||
@@ -251,8 +250,7 @@ describe('vim.ui_attach', function()
|
||||
|
||||
it('error in callback is logged', function()
|
||||
clear({ env = { NVIM_LOG_FILE = testlog } })
|
||||
local screen = Screen.new()
|
||||
screen:attach()
|
||||
local _ = Screen.new()
|
||||
exec_lua([[
|
||||
local ns = vim.api.nvim_create_namespace('testspace')
|
||||
vim.ui_attach(ns, { ext_popupmenu = true }, function() error(42) end)
|
||||
|
||||
Reference in New Issue
Block a user