aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/extmark_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/api/extmark_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/api/extmark_spec.lua')
-rw-r--r--test/functional/api/extmark_spec.lua10
1 files changed, 1 insertions, 9 deletions
diff --git a/test/functional/api/extmark_spec.lua b/test/functional/api/extmark_spec.lua
index 52d8fd5097..f8d6fca74c 100644
--- a/test/functional/api/extmark_spec.lua
+++ b/test/functional/api/extmark_spec.lua
@@ -455,7 +455,6 @@ describe('API/extmarks', function()
it('join works when no marks are present', function()
screen = Screen.new(15, 10)
- screen:attach()
feed('a<cr>1<esc>')
feed('kJ')
-- This shouldn't seg fault
@@ -508,7 +507,6 @@ describe('API/extmarks', function()
it('marks move with char inserts', function()
-- insertchar in edit.c (the ins_str branch)
screen = Screen.new(15, 10)
- screen:attach()
set_extmark(ns, marks[1], 0, 3)
feed('0')
insert('abc')
@@ -1726,7 +1724,6 @@ describe('API/extmarks', function()
it('invalidated marks are deleted', function()
screen = Screen.new(40, 6)
- screen:attach()
feed('dd6iaaa bbb ccc<CR><ESC>gg')
api.nvim_set_option_value('signcolumn', 'auto:2', {})
set_extmark(ns, 1, 0, 0, { invalidate = true, sign_text = 'S1', end_row = 1 })
@@ -1811,7 +1808,6 @@ describe('API/extmarks', function()
it('respects priority', function()
screen = Screen.new(15, 10)
- screen:attach()
set_extmark(ns, marks[1], 0, 0, {
hl_group = 'Comment',
@@ -1983,7 +1979,6 @@ describe('API/win_extmark', function()
it('sends and only sends ui-watched marks to ui', function()
screen = Screen.new(20, 4)
- screen:attach()
-- should send this
set_extmark(ns, marks[1], 1, 0, { ui_watched = true })
-- should not send this
@@ -2006,7 +2001,6 @@ describe('API/win_extmark', function()
it('sends multiple ui-watched marks to ui', function()
screen = Screen.new(20, 4)
- screen:attach()
feed('15A!<Esc>')
-- should send all of these
set_extmark(ns, marks[1], 1, 0, { ui_watched = true, virt_text_pos = 'overlay' })
@@ -2052,7 +2046,6 @@ describe('API/win_extmark', function()
it('updates ui-watched marks', function()
screen = Screen.new(20, 4)
- screen:attach()
-- should send this
set_extmark(ns, marks[1], 1, 0, { ui_watched = true })
-- should not send this
@@ -2096,8 +2089,7 @@ describe('API/win_extmark', function()
end)
it('sends ui-watched to splits', function()
- screen = Screen.new(20, 8)
- screen:attach({ ext_multigrid = true })
+ screen = Screen.new(20, 8, { ext_multigrid = true })
-- should send this
set_extmark(ns, marks[1], 1, 0, { ui_watched = true })
-- should not send this