mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
test: typing for helpers.meths
This commit is contained in:
@@ -10,7 +10,7 @@ local feed = helpers.feed
|
||||
local write_file = helpers.write_file
|
||||
local pcall_err = helpers.pcall_err
|
||||
local cursor = function()
|
||||
return helpers.meths.win_get_cursor(0)
|
||||
return helpers.meths.nvim_win_get_cursor(0)
|
||||
end
|
||||
|
||||
describe('named marks', function()
|
||||
@@ -105,7 +105,7 @@ describe('named marks', function()
|
||||
feed('mA')
|
||||
command('next')
|
||||
feed("'A")
|
||||
eq(1, meths.get_current_buf().id)
|
||||
eq(1, meths.nvim_get_current_buf().id)
|
||||
eq({ 2, 0 }, cursor())
|
||||
end)
|
||||
|
||||
@@ -118,7 +118,7 @@ describe('named marks', function()
|
||||
feed('mA')
|
||||
command('next')
|
||||
feed('`A')
|
||||
eq(1, meths.get_current_buf().id)
|
||||
eq(1, meths.nvim_get_current_buf().id)
|
||||
eq({ 2, 2 }, cursor())
|
||||
end)
|
||||
|
||||
@@ -131,7 +131,7 @@ describe('named marks', function()
|
||||
feed('mA')
|
||||
command('next')
|
||||
feed("g'A")
|
||||
eq(1, meths.get_current_buf().id)
|
||||
eq(1, meths.nvim_get_current_buf().id)
|
||||
eq({ 2, 0 }, cursor())
|
||||
end)
|
||||
|
||||
@@ -144,7 +144,7 @@ describe('named marks', function()
|
||||
feed('mA')
|
||||
command('next')
|
||||
feed('g`A')
|
||||
eq(1, meths.get_current_buf().id)
|
||||
eq(1, meths.nvim_get_current_buf().id)
|
||||
eq({ 2, 2 }, cursor())
|
||||
end)
|
||||
|
||||
@@ -158,7 +158,7 @@ describe('named marks', function()
|
||||
feed('mA')
|
||||
command('next')
|
||||
command("'A")
|
||||
eq(1, meths.get_current_buf().id)
|
||||
eq(1, meths.nvim_get_current_buf().id)
|
||||
eq({ 2, 0 }, cursor())
|
||||
end)
|
||||
|
||||
@@ -303,24 +303,24 @@ describe('named marks', function()
|
||||
end)
|
||||
|
||||
it("getting '{ '} '( ') does not move cursor", function()
|
||||
meths.buf_set_lines(0, 0, 0, true, { 'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee' })
|
||||
meths.win_set_cursor(0, { 2, 0 })
|
||||
meths.nvim_buf_set_lines(0, 0, 0, true, { 'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee' })
|
||||
meths.nvim_win_set_cursor(0, { 2, 0 })
|
||||
funcs.getpos("'{")
|
||||
eq({ 2, 0 }, meths.win_get_cursor(0))
|
||||
eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
|
||||
funcs.getpos("'}")
|
||||
eq({ 2, 0 }, meths.win_get_cursor(0))
|
||||
eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
|
||||
funcs.getpos("'(")
|
||||
eq({ 2, 0 }, meths.win_get_cursor(0))
|
||||
eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
|
||||
funcs.getpos("')")
|
||||
eq({ 2, 0 }, meths.win_get_cursor(0))
|
||||
eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
|
||||
end)
|
||||
|
||||
it('in command range does not move cursor #19248', function()
|
||||
meths.create_user_command('Test', ':', { range = true })
|
||||
meths.buf_set_lines(0, 0, 0, true, { 'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee' })
|
||||
meths.win_set_cursor(0, { 2, 0 })
|
||||
meths.nvim_create_user_command('Test', ':', { range = true })
|
||||
meths.nvim_buf_set_lines(0, 0, 0, true, { 'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee' })
|
||||
meths.nvim_win_set_cursor(0, { 2, 0 })
|
||||
command([['{,'}Test]])
|
||||
eq({ 2, 0 }, meths.win_get_cursor(0))
|
||||
eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user