aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/bufhl_spec.lua121
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua29
-rw-r--r--test/functional/ui/decorations_spec.lua5
-rw-r--r--test/functional/ui/float_spec.lua7
-rw-r--r--test/functional/ui/highlight_spec.lua3
-rw-r--r--test/functional/ui/inccommand_spec.lua13
-rw-r--r--test/functional/ui/linematch_spec.lua8
-rw-r--r--test/functional/ui/multigrid_spec.lua2
-rw-r--r--test/functional/ui/spell_spec.lua11
-rw-r--r--test/functional/ui/title_spec.lua2
-rw-r--r--test/functional/ui/winbar_spec.lua3
11 files changed, 99 insertions, 105 deletions
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index 13fea71fec..2cde0a8688 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -4,8 +4,9 @@ local Screen = require('test.functional.ui.screen')
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local command, neq = helpers.command, helpers.neq
local meths = helpers.meths
-local curbufmeths, eq = helpers.curbufmeths, helpers.eq
+local eq = helpers.eq
local pcall_err = helpers.pcall_err
+local set_virtual_text = meths.nvim_buf_set_virtual_text
describe('Buffer highlighting', function()
local screen
@@ -39,8 +40,8 @@ describe('Buffer highlighting', function()
})
end)
- local add_highlight = curbufmeths.add_highlight
- local clear_namespace = curbufmeths.clear_namespace
+ local add_highlight = meths.nvim_buf_add_highlight
+ local clear_namespace = meths.nvim_buf_clear_namespace
it('works', function()
insert([[
@@ -55,8 +56,8 @@ describe('Buffer highlighting', function()
|
]])
- add_highlight(-1, 'String', 0, 10, 14)
- add_highlight(-1, 'Statement', 1, 5, -1)
+ add_highlight(0, -1, 'String', 0, 10, 14)
+ add_highlight(0, -1, 'Statement', 1, 5, -1)
screen:expect([[
these are {2:some} lines |
@@ -74,7 +75,7 @@ describe('Buffer highlighting', function()
|
]])
- clear_namespace(-1, 0, -1)
+ clear_namespace(0, -1, 0, -1)
screen:expect([[
these are some lines |
^ |
@@ -94,21 +95,21 @@ describe('Buffer highlighting', function()
from different sources]])
command('hi ImportantWord gui=bold cterm=bold')
- id1 = add_highlight(0, 'ImportantWord', 0, 2, 8)
- add_highlight(id1, 'ImportantWord', 1, 12, -1)
- add_highlight(id1, 'ImportantWord', 2, 0, 9)
- add_highlight(id1, 'ImportantWord', 3, 5, 14)
+ id1 = add_highlight(0, 0, 'ImportantWord', 0, 2, 8)
+ add_highlight(0, id1, 'ImportantWord', 1, 12, -1)
+ add_highlight(0, id1, 'ImportantWord', 2, 0, 9)
+ add_highlight(0, id1, 'ImportantWord', 3, 5, 14)
-- add_highlight can be called like this to get a new source
-- without adding any highlight
- id2 = add_highlight(0, '', 0, 0, 0)
+ id2 = add_highlight(0, 0, '', 0, 0, 0)
neq(id1, id2)
- add_highlight(id2, 'Special', 0, 2, 8)
- add_highlight(id2, 'Identifier', 1, 3, 8)
- add_highlight(id2, 'Special', 1, 14, 20)
- add_highlight(id2, 'Underlined', 2, 6, 12)
- add_highlight(id2, 'Underlined', 3, 0, 9)
+ add_highlight(0, id2, 'Special', 0, 2, 8)
+ add_highlight(0, id2, 'Identifier', 1, 3, 8)
+ add_highlight(0, id2, 'Special', 1, 14, 20)
+ add_highlight(0, id2, 'Underlined', 2, 6, 12)
+ add_highlight(0, id2, 'Underlined', 3, 0, 9)
screen:expect([[
a {5:longer} example |
@@ -121,7 +122,7 @@ describe('Buffer highlighting', function()
end)
it('and clearing the first added', function()
- clear_namespace(id1, 0, -1)
+ clear_namespace(0, id1, 0, -1)
screen:expect([[
a {4:longer} example |
in {6:order} to de{4:monstr}ate |
@@ -133,7 +134,7 @@ describe('Buffer highlighting', function()
end)
it('and clearing using deprecated name', function()
- curbufmeths.clear_highlight(id1, 0, -1)
+ meths.nvim_buf_clear_highlight(0, id1, 0, -1)
screen:expect([[
a {4:longer} example |
in {6:order} to de{4:monstr}ate |
@@ -145,7 +146,7 @@ describe('Buffer highlighting', function()
end)
it('and clearing the second added', function()
- clear_namespace(id2, 0, -1)
+ clear_namespace(0, id2, 0, -1)
screen:expect([[
a {7:longer} example |
in order to {7:demonstrate} |
@@ -157,9 +158,9 @@ describe('Buffer highlighting', function()
end)
it('and clearing line ranges', function()
- clear_namespace(-1, 0, 1)
- clear_namespace(id1, 1, 2)
- clear_namespace(id2, 2, -1)
+ clear_namespace(0, -1, 0, 1)
+ clear_namespace(0, id1, 1, 2)
+ clear_namespace(0, id2, 2, -1)
screen:expect([[
a longer example |
in {6:order} to de{4:monstr}ate |
@@ -449,9 +450,9 @@ describe('Buffer highlighting', function()
pending('prioritizes latest added highlight', function()
insert([[
three overlapping colors]])
- add_highlight(0, 'Identifier', 0, 6, 17)
- add_highlight(0, 'String', 0, 14, 23)
- local id = add_highlight(0, 'Special', 0, 0, 9)
+ add_highlight(0, 0, 'Identifier', 0, 6, 17)
+ add_highlight(0, 0, 'String', 0, 14, 23)
+ local id = add_highlight(0, 0, 'Special', 0, 0, 9)
screen:expect([[
{4:three ove}{6:rlapp}{2:ing color}^s |
@@ -459,7 +460,7 @@ describe('Buffer highlighting', function()
|
]])
- clear_namespace(id, 0, 1)
+ clear_namespace(0, id, 0, 1)
screen:expect([[
three {6:overlapp}{2:ing color}^s |
{1:~ }|*6
@@ -470,9 +471,9 @@ describe('Buffer highlighting', function()
it('prioritizes earlier highlight groups (TEMP)', function()
insert([[
three overlapping colors]])
- add_highlight(0, 'Identifier', 0, 6, 17)
- add_highlight(0, 'String', 0, 14, 23)
- local id = add_highlight(0, 'Special', 0, 0, 9)
+ add_highlight(0, 0, 'Identifier', 0, 6, 17)
+ add_highlight(0, 0, 'String', 0, 14, 23)
+ local id = add_highlight(0, 0, 'Special', 0, 0, 9)
screen:expect {
grid = [[
@@ -482,7 +483,7 @@ describe('Buffer highlighting', function()
]],
}
- clear_namespace(id, 0, 1)
+ clear_namespace(0, id, 0, 1)
screen:expect {
grid = [[
three {6:overlapp}{2:ing color}^s |
@@ -493,17 +494,16 @@ describe('Buffer highlighting', function()
end)
it('respects priority', function()
- local set_extmark = curbufmeths.set_extmark
local id = meths.nvim_create_namespace('')
insert [[foobar]]
- set_extmark(id, 0, 0, {
+ meths.nvim_buf_set_extmark(0, id, 0, 0, {
end_line = 0,
end_col = 5,
hl_group = 'Statement',
priority = 100,
})
- set_extmark(id, 0, 0, {
+ meths.nvim_buf_set_extmark(0, id, 0, 0, {
end_line = 0,
end_col = 6,
hl_group = 'String',
@@ -516,7 +516,7 @@ describe('Buffer highlighting', function()
|
]]
- clear_namespace(id, 0, -1)
+ clear_namespace(0, id, 0, -1)
screen:expect {
grid = [[
fooba^r |
@@ -525,13 +525,13 @@ describe('Buffer highlighting', function()
]],
}
- set_extmark(id, 0, 0, {
+ meths.nvim_buf_set_extmark(0, id, 0, 0, {
end_line = 0,
end_col = 6,
hl_group = 'String',
priority = 1,
})
- set_extmark(id, 0, 0, {
+ meths.nvim_buf_set_extmark(0, id, 0, 0, {
end_line = 0,
end_col = 5,
hl_group = 'Statement',
@@ -548,8 +548,8 @@ describe('Buffer highlighting', function()
it('works with multibyte text', function()
insert([[
Ta båten över sjön!]])
- add_highlight(-1, 'Identifier', 0, 3, 9)
- add_highlight(-1, 'String', 0, 16, 21)
+ add_highlight(0, -1, 'Identifier', 0, 3, 9)
+ add_highlight(0, -1, 'String', 0, 16, 21)
screen:expect([[
Ta {6:båten} över {2:sjön}^! |
@@ -561,7 +561,7 @@ describe('Buffer highlighting', function()
it('works with new syntax groups', function()
insert([[
fancy code in a new fancy language]])
- add_highlight(-1, 'FancyLangItem', 0, 0, 5)
+ add_highlight(0, -1, 'FancyLangItem', 0, 0, 5)
screen:expect([[
fancy code in a new fancy languag^e |
{1:~ }|*6
@@ -577,7 +577,6 @@ describe('Buffer highlighting', function()
end)
describe('virtual text decorations', function()
- local set_virtual_text = curbufmeths.set_virtual_text
local id1, id2
before_each(function()
insert([[
@@ -595,9 +594,9 @@ describe('Buffer highlighting', function()
|
]])
- id1 = set_virtual_text(0, 0, { { '=', 'Statement' }, { ' 3', 'Number' } }, {})
- set_virtual_text(id1, 1, { { 'ERROR:', 'ErrorMsg' }, { ' invalid syntax' } }, {})
- id2 = set_virtual_text(0, 2, {
+ id1 = set_virtual_text(0, 0, 0, { { '=', 'Statement' }, { ' 3', 'Number' } }, {})
+ set_virtual_text(0, id1, 1, { { 'ERROR:', 'ErrorMsg' }, { ' invalid syntax' } }, {})
+ id2 = set_virtual_text(0, 0, 2, {
{
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
},
@@ -616,7 +615,7 @@ describe('Buffer highlighting', function()
|
]])
- clear_namespace(id1, 0, -1)
+ clear_namespace(0, id1, 0, -1)
screen:expect([[
^1 + 2 |
3 + |
@@ -632,6 +631,7 @@ describe('Buffer highlighting', function()
eq(
-1,
set_virtual_text(
+ 0,
-1,
1,
{ { '暗x事zz速野谷質結育副住新覚丸活解終事', 'Comment' } },
@@ -687,22 +687,22 @@ describe('Buffer highlighting', function()
-- this used to leak memory
eq(
"Invalid 'chunk': expected Array, got String",
- pcall_err(set_virtual_text, id1, 0, { 'texty' }, {})
+ pcall_err(set_virtual_text, 0, id1, 0, { 'texty' }, {})
)
eq(
"Invalid 'chunk': expected Array, got String",
- pcall_err(set_virtual_text, id1, 0, { { 'very' }, 'texty' }, {})
+ pcall_err(set_virtual_text, 0, id1, 0, { { 'very' }, 'texty' }, {})
)
end)
it('can be retrieved', function()
- local get_extmarks = curbufmeths.get_extmarks
- local line_count = curbufmeths.line_count
+ local get_extmarks = meths.nvim_buf_get_extmarks
+ local line_count = meths.nvim_buf_line_count
local s1 = { { 'Köttbullar', 'Comment' }, { 'Kräuterbutter' } }
local s2 = { { 'こんにちは', 'Comment' } }
- set_virtual_text(id1, 0, s1, {})
+ set_virtual_text(0, id1, 0, s1, {})
eq({
{
1,
@@ -719,10 +719,10 @@ describe('Buffer highlighting', function()
virt_text_hide = false,
},
},
- }, get_extmarks(id1, { 0, 0 }, { 0, -1 }, { details = true }))
+ }, get_extmarks(0, id1, { 0, 0 }, { 0, -1 }, { details = true }))
- local lastline = line_count()
- set_virtual_text(id1, line_count(), s2, {})
+ local lastline = line_count(0)
+ set_virtual_text(0, id1, line_count(0), s2, {})
eq({
{
3,
@@ -739,9 +739,9 @@ describe('Buffer highlighting', function()
virt_text_hide = false,
},
},
- }, get_extmarks(id1, { lastline, 0 }, { lastline, -1 }, { details = true }))
+ }, get_extmarks(0, id1, { lastline, 0 }, { lastline, -1 }, { details = true }))
- eq({}, get_extmarks(id1, { lastline + 9000, 0 }, { lastline + 9000, -1 }, {}))
+ eq({}, get_extmarks(0, id1, { lastline + 9000, 0 }, { lastline + 9000, -1 }, {}))
end)
it('is not highlighted by visual selection', function()
@@ -814,7 +814,7 @@ describe('Buffer highlighting', function()
|
]])
- clear_namespace(-1, 0, -1)
+ clear_namespace(0, -1, 0, -1)
screen:expect([[
^1 + 2{1:$} |
3 +{1:$} |
@@ -869,7 +869,7 @@ describe('Buffer highlighting', function()
end)
it('works with color column', function()
- eq(-1, set_virtual_text(-1, 3, { { '暗x事', 'Comment' } }, {}))
+ eq(-1, set_virtual_text(0, -1, 3, { { '暗x事', 'Comment' } }, {}))
screen:expect {
grid = [[
^1 + 2 {3:=}{2: 3} |
@@ -898,12 +898,11 @@ describe('Buffer highlighting', function()
end)
it('and virtual text use the same namespace counter', function()
- local set_virtual_text = curbufmeths.set_virtual_text
- eq(1, add_highlight(0, 'String', 0, 0, -1))
- eq(2, set_virtual_text(0, 0, { { '= text', 'Comment' } }, {}))
+ eq(1, add_highlight(0, 0, 'String', 0, 0, -1))
+ eq(2, set_virtual_text(0, 0, 0, { { '= text', 'Comment' } }, {}))
eq(3, meths.nvim_create_namespace('my-ns'))
- eq(4, add_highlight(0, 'String', 0, 0, -1))
- eq(5, set_virtual_text(0, 0, { { '= text', 'Comment' } }, {}))
+ eq(4, add_highlight(0, 0, 'String', 0, 0, -1))
+ eq(5, set_virtual_text(0, 0, 0, { { '= text', 'Comment' } }, {}))
eq(6, meths.nvim_create_namespace('other-ns'))
end)
end)
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index 99f6e2eed8..a26c529396 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -10,7 +10,6 @@ local source = helpers.source
local exec_capture = helpers.exec_capture
local dedent = helpers.dedent
local command = helpers.command
-local curbufmeths = helpers.curbufmeths
local screen
@@ -503,7 +502,7 @@ describe('Command-line coloring', function()
]]))
eq(
{ '', ':', 'E888 detected for \\ze*', ':', 'E888 detected for \\zs*' },
- curbufmeths.get_lines(0, -1, false)
+ meths.nvim_buf_get_lines(0, 0, -1, false)
)
eq('', funcs.execute('messages'))
end)
@@ -646,7 +645,7 @@ describe('Ex commands coloring', function()
]]))
eq(
{ '', 'E888 detected for \\ze*', 'E888 detected for \\zs*' },
- curbufmeths.get_lines(0, -1, false)
+ meths.nvim_buf_get_lines(0, 0, -1, false)
)
eq('', funcs.execute('messages'))
end)
@@ -725,10 +724,10 @@ describe('Ex commands coloring', function()
end)
describe('Expressions coloring support', function()
it('works', function()
- meths.nvim_command('hi clear NvimNumber')
- meths.nvim_command('hi clear NvimNestingParenthesis')
- meths.nvim_command('hi NvimNumber guifg=Blue2')
- meths.nvim_command('hi NvimNestingParenthesis guifg=Yellow')
+ command('hi clear NvimNumber')
+ command('hi clear NvimNestingParenthesis')
+ command('hi NvimNumber guifg=Blue2')
+ command('hi NvimNestingParenthesis guifg=Yellow')
feed(':echo <C-r>=(((1)))')
screen:expect([[
|
@@ -739,8 +738,8 @@ describe('Expressions coloring support', function()
it('does not use Nvim_color_expr', function()
meths.nvim_set_var('Nvim_color_expr', 42)
-- Used to error out due to failing to get callback.
- meths.nvim_command('hi clear NvimNumber')
- meths.nvim_command('hi NvimNumber guifg=Blue2')
+ command('hi clear NvimNumber')
+ command('hi NvimNumber guifg=Blue2')
feed(':<C-r>=1')
screen:expect([[
|
@@ -749,12 +748,12 @@ describe('Expressions coloring support', function()
]])
end)
it('works correctly with non-ASCII and control characters', function()
- meths.nvim_command('hi clear NvimStringBody')
- meths.nvim_command('hi clear NvimStringQuote')
- meths.nvim_command('hi clear NvimInvalid')
- meths.nvim_command('hi NvimStringQuote guifg=Blue3')
- meths.nvim_command('hi NvimStringBody guifg=Blue4')
- meths.nvim_command('hi NvimInvalid guifg=Red guibg=Blue')
+ command('hi clear NvimStringBody')
+ command('hi clear NvimStringQuote')
+ command('hi clear NvimInvalid')
+ command('hi NvimStringQuote guifg=Blue3')
+ command('hi NvimStringBody guifg=Blue4')
+ command('hi NvimInvalid guifg=Red guibg=Blue')
feed('i<C-r>="«»"«»')
screen:expect([[
|
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 91a5f10c84..42c9c706d1 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -9,7 +9,6 @@ local exec = helpers.exec
local expect_events = helpers.expect_events
local meths = helpers.meths
local funcs = helpers.funcs
-local curbufmeths = helpers.curbufmeths
local command = helpers.command
local eq = helpers.eq
local assert_alive = helpers.assert_alive
@@ -244,7 +243,7 @@ describe('decorations providers', function()
-- spell=false with higher priority does disable spell
local ns = meths.nvim_create_namespace "spell"
- local id = curbufmeths.set_extmark(ns, 0, 0, { priority = 30, end_row = 2, end_col = 23, spell = false })
+ local id = meths.nvim_buf_set_extmark(0, ns, 0, 0, { priority = 30, end_row = 2, end_col = 23, spell = false })
screen:expect{grid=[[
I am well written text. |
@@ -267,7 +266,7 @@ describe('decorations providers', function()
command('echo ""')
-- spell=false with lower priority doesn't disable spell
- curbufmeths.set_extmark(ns, 0, 0, { id = id, priority = 10, end_row = 2, end_col = 23, spell = false })
+ meths.nvim_buf_set_extmark(0, ns, 0, 0, { id = id, priority = 10, end_row = 2, end_col = 23, spell = false })
screen:expect{grid=[[
I am well written text. |
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 645cce25aa..944e40876f 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -12,12 +12,13 @@ local exec = helpers.exec
local exec_lua = helpers.exec_lua
local insert = helpers.insert
local meths = helpers.meths
-local curbufmeths = helpers.curbufmeths
local funcs = helpers.funcs
local run = helpers.run
local pcall_err = helpers.pcall_err
local tbl_contains = vim.tbl_contains
-local curbuf, curwin, curtab = helpers.curbuf, helpers.curwin, helpers.curtab
+local curbuf = helpers.meths.nvim_get_current_buf
+local curwin = helpers.meths.nvim_get_current_win
+local curtab = helpers.meths.nvim_get_current_tabpage
local NIL = vim.NIL
describe('float window', function()
@@ -6624,7 +6625,7 @@ describe('float window', function()
for i = 1,5 do
feed(i.."<c-w>w")
feed_command("enew")
- curbufmeths.set_lines(0,-1,true,{tostring(i)})
+ meths.nvim_buf_set_lines(0, 0,-1,true,{tostring(i)})
end
if multigrid then
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 857fd29f19..c2a7317da0 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -5,7 +5,6 @@ local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local command, exec = helpers.command, helpers.exec
local eval = helpers.eval
local feed_command, eq = helpers.feed_command, helpers.eq
-local curbufmeths = helpers.curbufmeths
local funcs = helpers.funcs
local meths = helpers.meths
local exec_lua = helpers.exec_lua
@@ -2088,7 +2087,7 @@ describe("'winhighlight' highlight", function()
end)
it('can override NonText, Conceal and EndOfBuffer', function()
- curbufmeths.set_lines(0, -1, true, { 'raa\000' })
+ meths.nvim_buf_set_lines(0, 0, -1, true, { 'raa\000' })
command('call matchaddpos("Conceal", [[1,2]], 0, -1, {"conceal": "#"})')
command('set cole=2 cocu=nvic')
command('split')
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index c97fd02562..e82f889553 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -14,7 +14,6 @@ local ok = helpers.ok
local retry = helpers.retry
local source = helpers.source
local poke_eventloop = helpers.poke_eventloop
-local nvim = helpers.nvim
local sleep = vim.uv.sleep
local testprg = helpers.testprg
local assert_alive = helpers.assert_alive
@@ -1898,20 +1897,20 @@ describe("'inccommand' with 'gdefault'", function()
common_setup(nil, 'nosplit', '{')
command('set gdefault')
feed(':s/{\\n')
- eq({ mode = 'c', blocking = false }, nvim('get_mode'))
+ eq({ mode = 'c', blocking = false }, meths.nvim_get_mode())
feed('/A<Enter>')
expect('A')
- eq({ mode = 'n', blocking = false }, nvim('get_mode'))
+ eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
end)
it('with multiline text and range, does not lock up #7244', function()
common_setup(nil, 'nosplit', '{\n\n{')
command('set gdefault')
feed(':%s/{\\n')
- eq({ mode = 'c', blocking = false }, nvim('get_mode'))
+ eq({ mode = 'c', blocking = false }, meths.nvim_get_mode())
feed('/A<Enter>')
expect('A\nA')
- eq({ mode = 'n', blocking = false }, nvim('get_mode'))
+ eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
end)
it('does not crash on zero-width matches #7485', function()
@@ -1920,9 +1919,9 @@ describe("'inccommand' with 'gdefault'", function()
feed('gg')
feed('Vj')
feed(':s/\\%V')
- eq({ mode = 'c', blocking = false }, nvim('get_mode'))
+ eq({ mode = 'c', blocking = false }, meths.nvim_get_mode())
feed('<Esc>')
- eq({ mode = 'n', blocking = false }, nvim('get_mode'))
+ eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
end)
it('removes highlights after abort for a zero-width match', function()
diff --git a/test/functional/ui/linematch_spec.lua b/test/functional/ui/linematch_spec.lua
index ca02fa6403..98ada8f6c4 100644
--- a/test/functional/ui/linematch_spec.lua
+++ b/test/functional/ui/linematch_spec.lua
@@ -1118,9 +1118,9 @@ describe('regressions', function()
screen = Screen.new(100, 20)
screen:attach()
-- line must be greater than MATCH_CHAR_MAX_LEN
- helpers.curbufmeths.set_lines(0, -1, false, { string.rep('a', 1000) .. 'hello' })
+ helpers.meths.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1000) .. 'hello' })
helpers.exec 'vnew'
- helpers.curbufmeths.set_lines(0, -1, false, { string.rep('a', 1010) .. 'world' })
+ helpers.meths.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1010) .. 'world' })
helpers.exec 'windo diffthis'
end)
@@ -1133,9 +1133,9 @@ describe('regressions', function()
for i = 0, 29 do
lines[#lines + 1] = tostring(i)
end
- helpers.curbufmeths.set_lines(0, -1, false, lines)
+ helpers.meths.nvim_buf_set_lines(0, 0, -1, false, lines)
helpers.exec 'vnew'
- helpers.curbufmeths.set_lines(0, -1, false, { '00', '29' })
+ helpers.meths.nvim_buf_set_lines(0, 0, -1, false, { '00', '29' })
helpers.exec 'windo diffthis'
feed('<C-e>')
screen:expect {
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index 094e27e69a..600b08744f 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -5,7 +5,7 @@ local feed, command, insert = helpers.feed, helpers.command, helpers.insert
local eq = helpers.eq
local funcs = helpers.funcs
local meths = helpers.meths
-local curwin = helpers.curwin
+local curwin = helpers.meths.nvim_get_current_win
local poke_eventloop = helpers.poke_eventloop
diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua
index c9730cee97..f52ae29562 100644
--- a/test/functional/ui/spell_spec.lua
+++ b/test/functional/ui/spell_spec.lua
@@ -7,7 +7,6 @@ local exec = helpers.exec
local feed = helpers.feed
local insert = helpers.insert
local meths = helpers.meths
-local curbufmeths = helpers.curbufmeths
local is_os = helpers.is_os
describe("'spell'", function()
@@ -262,7 +261,7 @@ describe("'spell'", function()
exec('echo ""')
local ns = meths.nvim_create_namespace('spell')
-- extmark with spell=true enables spell
- local id = curbufmeths.set_extmark(ns, 1, 4, { end_row = 1, end_col = 10, spell = true })
+ local id = meths.nvim_buf_set_extmark(0, ns, 1, 4, { end_row = 1, end_col = 10, spell = true })
screen:expect([[
{3:#include }{4:<stdbool.h>} |
{5:bool} {1:func}({5:void}); |
@@ -278,9 +277,9 @@ describe("'spell'", function()
{0:~ }|*4
|
]])
- curbufmeths.del_extmark(ns, id)
+ meths.nvim_buf_del_extmark(0, ns, id)
-- extmark with spell=false disables spell
- id = curbufmeths.set_extmark(ns, 2, 18, { end_row = 2, end_col = 26, spell = false })
+ id = meths.nvim_buf_set_extmark(0, ns, 2, 18, { end_row = 2, end_col = 26, spell = false })
screen:expect([[
{3:#include }{4:<stdbool.h>} |
{5:bool} ^func({5:void}); |
@@ -297,7 +296,7 @@ describe("'spell'", function()
{6:search hit TOP, continuing at BOTTOM} |
]])
exec('echo ""')
- curbufmeths.del_extmark(ns, id)
+ meths.nvim_buf_del_extmark(0, ns, id)
screen:expect([[
{3:#include }{4:<stdbool.h>} |
{5:bool} func({5:void}); |
@@ -369,7 +368,7 @@ describe("'spell'", function()
call setline(1, "This is some text without any spell errors.")
]])
local ns = meths.nvim_create_namespace('spell')
- curbufmeths.set_extmark(ns, 0, 0, { hl_group = 'WarningMsg', end_col = 43 })
+ meths.nvim_buf_set_extmark(0, ns, 0, 0, { hl_group = 'WarningMsg', end_col = 43 })
screen:expect([[
{6:^This is some text without any spell errors.}|
{0:~ }|
diff --git a/test/functional/ui/title_spec.lua b/test/functional/ui/title_spec.lua
index 222850ee42..598952404d 100644
--- a/test/functional/ui/title_spec.lua
+++ b/test/functional/ui/title_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
-local curwin = helpers.curwin
+local curwin = helpers.meths.nvim_get_current_win
local eq = helpers.eq
local exec_lua = helpers.exec_lua
local feed = helpers.feed
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua
index 6a09d3a555..5e914952e3 100644
--- a/test/functional/ui/winbar_spec.lua
+++ b/test/functional/ui/winbar_spec.lua
@@ -8,7 +8,6 @@ local eq = helpers.eq
local poke_eventloop = helpers.poke_eventloop
local feed = helpers.feed
local funcs = helpers.funcs
-local curwin = helpers.curwin
local pcall_err = helpers.pcall_err
describe('winbar', function()
@@ -52,7 +51,7 @@ describe('winbar', function()
]])
-- winbar is excluded from the heights returned by winheight() and getwininfo()
eq(11, funcs.winheight(0))
- local win_info = funcs.getwininfo(curwin().id)[1]
+ local win_info = funcs.getwininfo(meths.nvim_get_current_win().id)[1]
eq(11, win_info.height)
eq(1, win_info.winbar)
end)