diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-11-11 22:15:19 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-11-14 12:40:57 +0100 |
commit | e61228a214ebda9845db9462dad0a8c362d3963f (patch) | |
tree | fc5908c85c0cc6affc3bc325cd75f6efaeea95d8 /test/functional/ui/screen_basic_spec.lua | |
parent | 40dee8a2dcba996badaa6182eb34fde1694f92a3 (diff) | |
download | rneovim-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/ui/screen_basic_spec.lua')
-rw-r--r-- | test/functional/ui/screen_basic_spec.lua | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 85a653df36..f39e9ecc33 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -29,7 +29,6 @@ describe('screen', function() local screen_nvim = spawn(nvim_argv) set_session(screen_nvim) screen = Screen.new() - screen:attach() end) it('default initial screen', function() @@ -47,8 +46,7 @@ local function screen_tests(linegrid) before_each(function() clear() - screen = Screen.new() - screen:attach({ rgb = true, ext_linegrid = linegrid }) + screen = Screen.new(53, 14, { rgb = true, ext_linegrid = linegrid }) screen:set_default_attr_ids({ [0] = { bold = true, foreground = 255 }, [1] = { bold = true, reverse = true }, @@ -717,8 +715,7 @@ describe('Screen default colors', function() } local screen_nvim = spawn(nvim_argv) set_session(screen_nvim) - screen = Screen.new() - screen:attach(termcolors and { rgb = true, ext_termcolors = true } or { rgb = true }) + screen = Screen.new(53, 14, { rgb = true, ext_termcolors = termcolors or nil }) end it('are dark per default', function() @@ -777,7 +774,6 @@ end) it('CTRL-F or CTRL-B scrolls a page after UI attach/resize #20605', function() clear() local screen = Screen.new(100, 100) - screen:attach() eq(100, api.nvim_get_option_value('lines', {})) eq(99, api.nvim_get_option_value('window', {})) eq(99, api.nvim_win_get_height(0)) @@ -810,7 +806,6 @@ end) it("showcmd doesn't cause empty grid_line with redrawdebug=compositor #22593", function() clear() local screen = Screen.new(30, 2) - screen:attach() command('set showcmd redrawdebug=compositor') feed('d') screen:expect { @@ -824,7 +819,6 @@ end) it("scrolling in narrow window doesn't draw over separator #29033", function() clear() local screen = Screen.new(60, 8) - screen:attach() feed('100Oa<Esc>gg') exec([[ set number nowrap |