mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00: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:
@ -354,8 +354,7 @@ end)
|
||||
describe(':terminal prints more lines than the screen height and exits', function()
|
||||
it('will push extra lines to scrollback', function()
|
||||
clear()
|
||||
local screen = Screen.new(30, 7)
|
||||
screen:attach({ rgb = false })
|
||||
local screen = Screen.new(30, 7, { rgb = false })
|
||||
command(("call termopen(['%s', '10']) | startinsert"):format(testprg('tty-test')))
|
||||
screen:expect([[
|
||||
line6 |
|
||||
@ -580,7 +579,6 @@ describe('pending scrollback line handling', function()
|
||||
before_each(function()
|
||||
clear()
|
||||
screen = Screen.new(30, 7)
|
||||
screen:attach()
|
||||
screen:set_default_attr_ids {
|
||||
[1] = { foreground = Screen.colors.Brown },
|
||||
[2] = { reverse = true },
|
||||
|
Reference in New Issue
Block a user