aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 17:59:57 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 18:59:14 +0000
commit795f896a5772d5e0795f86642bdf90c82efac45c (patch)
tree308f04fbee18d2ec3f00c12a8bec96b84d8907f0 /test/functional/editor
parent4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (diff)
downloadrneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.gz
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.bz2
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.zip
test: rename (meths, funcs) -> (api, fn)
Diffstat (limited to 'test/functional/editor')
-rw-r--r--test/functional/editor/K_spec.lua10
-rw-r--r--test/functional/editor/completion_spec.lua32
-rw-r--r--test/functional/editor/fold_spec.lua76
-rw-r--r--test/functional/editor/jump_spec.lua22
-rw-r--r--test/functional/editor/langmap_spec.lua4
-rw-r--r--test/functional/editor/macro_spec.lua44
-rw-r--r--test/functional/editor/mark_spec.lua72
-rw-r--r--test/functional/editor/meta_key_spec.lua8
-rw-r--r--test/functional/editor/mode_cmdline_spec.lua40
-rw-r--r--test/functional/editor/put_spec.lua82
-rw-r--r--test/functional/editor/tabpage_spec.lua38
-rw-r--r--test/functional/editor/undo_spec.lua4
12 files changed, 216 insertions, 216 deletions
diff --git a/test/functional/editor/K_spec.lua b/test/functional/editor/K_spec.lua
index bb7bcb7ca6..1fbdd1c142 100644
--- a/test/functional/editor/K_spec.lua
+++ b/test/functional/editor/K_spec.lua
@@ -1,6 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
-local eq, clear, eval, feed, meths, retry =
- helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.meths, helpers.retry
+local eq, clear, eval, feed, api, retry =
+ helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.api, helpers.retry
describe('K', function()
local test_file = 'K_spec_out'
@@ -61,9 +61,9 @@ describe('K', function()
end)
it('empty string falls back to :help #19298', function()
- meths.nvim_set_option_value('keywordprg', '', {})
- meths.nvim_buf_set_lines(0, 0, -1, true, { 'doesnotexist' })
+ api.nvim_set_option_value('keywordprg', '', {})
+ api.nvim_buf_set_lines(0, 0, -1, true, { 'doesnotexist' })
feed('K')
- eq('E149: Sorry, no help for doesnotexist', meths.nvim_get_vvar('errmsg'))
+ eq('E149: Sorry, no help for doesnotexist', api.nvim_get_vvar('errmsg'))
end)
end)
diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua
index f683884292..a7704fe12b 100644
--- a/test/functional/editor/completion_spec.lua
+++ b/test/functional/editor/completion_spec.lua
@@ -4,9 +4,9 @@ local assert_alive = helpers.assert_alive
local clear, feed = helpers.clear, helpers.feed
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
local feed_command, source, expect = helpers.feed_command, helpers.source, helpers.expect
-local funcs = helpers.funcs
+local fn = helpers.fn
local command = helpers.command
-local meths = helpers.meths
+local api = helpers.api
local poke_eventloop = helpers.poke_eventloop
describe('completion', function()
@@ -820,23 +820,23 @@ describe('completion', function()
end)
it('provides completion from `getcompletion()`', function()
- eq({ 'vim' }, funcs.getcompletion('vi', 'lua'))
- eq({ 'api' }, funcs.getcompletion('vim.ap', 'lua'))
- eq({ 'tbl_filter' }, funcs.getcompletion('vim.tbl_fil', 'lua'))
- eq({ 'vim' }, funcs.getcompletion('print(vi', 'lua'))
+ eq({ 'vim' }, fn.getcompletion('vi', 'lua'))
+ eq({ 'api' }, fn.getcompletion('vim.ap', 'lua'))
+ eq({ 'tbl_filter' }, fn.getcompletion('vim.tbl_fil', 'lua'))
+ eq({ 'vim' }, fn.getcompletion('print(vi', 'lua'))
-- fuzzy completion is not supported, so the result should be the same
command('set wildoptions+=fuzzy')
- eq({ 'vim' }, funcs.getcompletion('vi', 'lua'))
+ eq({ 'vim' }, fn.getcompletion('vi', 'lua'))
end)
end)
it('cmdline completion supports various string options', function()
- eq('auto', funcs.getcompletion('set foldcolumn=', 'cmdline')[2])
- eq({ 'nosplit', 'split' }, funcs.getcompletion('set inccommand=', 'cmdline'))
- eq({ 'ver:3,hor:6', 'hor:', 'ver:' }, funcs.getcompletion('set mousescroll=', 'cmdline'))
- eq('BS', funcs.getcompletion('set termpastefilter=', 'cmdline')[2])
- eq('SpecialKey', funcs.getcompletion('set winhighlight=', 'cmdline')[1])
- eq('SpecialKey', funcs.getcompletion('set winhighlight=NonText:', 'cmdline')[1])
+ eq('auto', fn.getcompletion('set foldcolumn=', 'cmdline')[2])
+ eq({ 'nosplit', 'split' }, fn.getcompletion('set inccommand=', 'cmdline'))
+ eq({ 'ver:3,hor:6', 'hor:', 'ver:' }, fn.getcompletion('set mousescroll=', 'cmdline'))
+ eq('BS', fn.getcompletion('set termpastefilter=', 'cmdline')[2])
+ eq('SpecialKey', fn.getcompletion('set winhighlight=', 'cmdline')[1])
+ eq('SpecialKey', fn.getcompletion('set winhighlight=NonText:', 'cmdline')[1])
end)
describe('from the commandline window', function()
@@ -882,8 +882,8 @@ describe('completion', function()
return ''
endfunction
]])
- meths.nvim_set_option_value('completeopt', 'menuone,noselect', {})
- meths.nvim_set_var('_complist', {
+ api.nvim_set_option_value('completeopt', 'menuone,noselect', {})
+ api.nvim_set_var('_complist', {
{
word = 0,
abbr = 1,
@@ -927,7 +927,7 @@ describe('completion', function()
end)
it('CompleteChanged autocommand', function()
- meths.nvim_buf_set_lines(0, 0, 1, false, { 'foo', 'bar', 'foobar', '' })
+ api.nvim_buf_set_lines(0, 0, 1, false, { 'foo', 'bar', 'foobar', '' })
source([[
set complete=. completeopt=noinsert,noselect,menuone
function! OnPumChange()
diff --git a/test/functional/editor/fold_spec.lua b/test/functional/editor/fold_spec.lua
index 3889067fd4..35632bb2f8 100644
--- a/test/functional/editor/fold_spec.lua
+++ b/test/functional/editor/fold_spec.lua
@@ -5,7 +5,7 @@ local insert = helpers.insert
local feed = helpers.feed
local expect = helpers.expect
local command = helpers.command
-local funcs = helpers.funcs
+local fn = helpers.fn
local eq = helpers.eq
local neq = helpers.neq
@@ -75,8 +75,8 @@ describe('Folds', function()
local function get_folds()
local rettab = {}
- for i = 1, funcs.line('$') do
- table.insert(rettab, funcs.foldlevel(i))
+ for i = 1, fn.line('$') do
+ table.insert(rettab, fn.foldlevel(i))
end
return rettab
end
@@ -140,21 +140,21 @@ a
a
a]])
-- lines are not closed, folds are correct
- for i = 1, funcs.line('$') do
- eq(-1, funcs.foldclosed(i))
+ for i = 1, fn.line('$') do
+ eq(-1, fn.foldclosed(i))
if i == 1 or i == 7 or i == 13 then
- eq(0, funcs.foldlevel(i))
+ eq(0, fn.foldlevel(i))
elseif i == 4 then
- eq(2, funcs.foldlevel(i))
+ eq(2, fn.foldlevel(i))
else
- eq(1, funcs.foldlevel(i))
+ eq(1, fn.foldlevel(i))
end
end
-- folds are not corrupted
feed('zM')
- eq(6, funcs.foldclosedend(2))
- eq(12, funcs.foldclosedend(8))
- eq(18, funcs.foldclosedend(14))
+ eq(6, fn.foldclosedend(2))
+ eq(12, fn.foldclosedend(8))
+ eq(18, fn.foldclosedend(14))
end)
it("doesn't split a fold when the move is within it", function()
@@ -330,13 +330,13 @@ a]],
a
]])
for i = 1, 2 do
- eq(1, funcs.foldlevel(i))
+ eq(1, fn.foldlevel(i))
end
for i = 3, 5 do
- eq(0, funcs.foldlevel(i))
+ eq(0, fn.foldlevel(i))
end
for i = 6, 8 do
- eq(1, funcs.foldlevel(i))
+ eq(1, fn.foldlevel(i))
end
end)
@@ -354,7 +354,7 @@ a]],
]])
command('setlocal foldmethod=indent')
command('3,5d')
- eq(5, funcs.foldclosedend(1))
+ eq(5, fn.foldclosedend(1))
end)
it("doesn't combine folds that have a specified end", function()
@@ -371,7 +371,7 @@ a]],
command('setlocal foldmethod=marker')
command('3,5d')
command('%foldclose')
- eq(2, funcs.foldclosedend(1))
+ eq(2, fn.foldclosedend(1))
end)
it('splits folds according to >N and <N with foldexpr', function()
@@ -415,20 +415,20 @@ a]],
command('foldopen')
command('read ' .. tempfname)
command('%foldclose')
- eq(2, funcs.foldclosedend(1))
- eq(0, funcs.foldlevel(3))
- eq(0, funcs.foldlevel(4))
- eq(6, funcs.foldclosedend(5))
- eq(10, funcs.foldclosedend(7))
- eq(14, funcs.foldclosedend(11))
+ eq(2, fn.foldclosedend(1))
+ eq(0, fn.foldlevel(3))
+ eq(0, fn.foldlevel(4))
+ eq(6, fn.foldclosedend(5))
+ eq(10, fn.foldclosedend(7))
+ eq(14, fn.foldclosedend(11))
end)
it('no folds remain if :delete makes buffer empty #19671', function()
command('setlocal foldmethod=manual')
- funcs.setline(1, { 'foo', 'bar', 'baz' })
+ fn.setline(1, { 'foo', 'bar', 'baz' })
command('2,3fold')
command('%delete')
- eq(0, funcs.foldlevel(1))
+ eq(0, fn.foldlevel(1))
end)
it('multibyte fold markers work #20438', function()
@@ -442,7 +442,7 @@ a]],
bbbbb/*«*/
bbbbb
bbbbb/*»*/]])
- eq(1, funcs.foldlevel(1))
+ eq(1, fn.foldlevel(1))
end)
it('updates correctly with indent method and visual blockwise insertion #22898', function()
@@ -452,8 +452,8 @@ a]],
]])
command('setlocal foldmethod=indent shiftwidth=2')
feed('gg0<C-v>jI <Esc>') -- indent both lines using visual blockwise mode
- eq(1, funcs.foldlevel(1))
- eq(1, funcs.foldlevel(2))
+ eq(1, fn.foldlevel(1))
+ eq(1, fn.foldlevel(2))
end)
it("doesn't open folds with indent method when inserting lower foldlevel line", function()
@@ -464,22 +464,22 @@ a]],
keep this line folded 2
]])
command('set foldmethod=indent shiftwidth=2 noautoindent')
- eq(1, funcs.foldlevel(1))
- eq(1, funcs.foldlevel(2))
- eq(2, funcs.foldlevel(3))
- eq(2, funcs.foldlevel(4))
+ eq(1, fn.foldlevel(1))
+ eq(1, fn.foldlevel(2))
+ eq(2, fn.foldlevel(3))
+ eq(2, fn.foldlevel(4))
feed('zo') -- open the outer fold
- neq(-1, funcs.foldclosed(3)) -- make sure the inner fold is not open
+ neq(-1, fn.foldclosed(3)) -- make sure the inner fold is not open
feed('gg0oa<Esc>') -- insert unindented line
- eq(1, funcs.foldlevel(1)) --| insert an unindented line under this line
- eq(0, funcs.foldlevel(2)) --|a
- eq(1, funcs.foldlevel(3)) --| keep the lines under this line folded
- eq(2, funcs.foldlevel(4)) --| keep this line folded 1
- eq(2, funcs.foldlevel(5)) --| keep this line folded 2
+ eq(1, fn.foldlevel(1)) --| insert an unindented line under this line
+ eq(0, fn.foldlevel(2)) --|a
+ eq(1, fn.foldlevel(3)) --| keep the lines under this line folded
+ eq(2, fn.foldlevel(4)) --| keep this line folded 1
+ eq(2, fn.foldlevel(5)) --| keep this line folded 2
- neq(-1, funcs.foldclosed(4)) -- make sure the inner fold is still not open
+ neq(-1, fn.foldclosed(4)) -- make sure the inner fold is still not open
end)
end)
diff --git a/test/functional/editor/jump_spec.lua b/test/functional/editor/jump_spec.lua
index 8787fd60f1..717284b7d1 100644
--- a/test/functional/editor/jump_spec.lua
+++ b/test/functional/editor/jump_spec.lua
@@ -4,11 +4,11 @@ local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
-local funcs = helpers.funcs
+local fn = helpers.fn
local feed = helpers.feed
local exec_capture = helpers.exec_capture
local write_file = helpers.write_file
-local meths = helpers.meths
+local api = helpers.api
describe('jumplist', function()
local fname1 = 'Xtest-functional-normal-jump'
@@ -20,7 +20,7 @@ describe('jumplist', function()
end)
it('does not add a new entry on startup', function()
- eq('\n jump line col file/text\n>', funcs.execute('jumps'))
+ eq('\n jump line col file/text\n>', fn.execute('jumps'))
end)
it('does not require two <C-O> strokes to jump back', function()
@@ -28,25 +28,25 @@ describe('jumplist', function()
write_file(fname2, 'second file contents')
command('args ' .. fname1 .. ' ' .. fname2)
- local buf1 = funcs.bufnr(fname1)
- local buf2 = funcs.bufnr(fname2)
+ local buf1 = fn.bufnr(fname1)
+ local buf2 = fn.bufnr(fname2)
command('next')
feed('<C-O>')
- eq(buf1, funcs.bufnr('%'))
+ eq(buf1, fn.bufnr('%'))
command('first')
command('snext')
feed('<C-O>')
- eq(buf1, funcs.bufnr('%'))
+ eq(buf1, fn.bufnr('%'))
feed('<C-I>')
- eq(buf2, funcs.bufnr('%'))
+ eq(buf2, fn.bufnr('%'))
feed('<C-O>')
- eq(buf1, funcs.bufnr('%'))
+ eq(buf1, fn.bufnr('%'))
command('drop ' .. fname2)
feed('<C-O>')
- eq(buf1, funcs.bufnr('%'))
+ eq(buf1, fn.bufnr('%'))
end)
it('<C-O> scrolls cursor halfway when switching buffer #25763', function()
@@ -284,7 +284,7 @@ describe('jumpoptions=view', function()
screen:attach()
command('edit ' .. file1)
feed('7GzbG')
- meths.nvim_buf_set_lines(0, 0, 2, true, {})
+ api.nvim_buf_set_lines(0, 0, 2, true, {})
-- Move to line 7, and set it as the last line visible on the view with zb, meaning to recover
-- the view it needs to put the cursor 7 lines from the top line. Then go to the end of the
-- file, delete 2 lines before line 7, meaning the jump/mark is moved 2 lines up to line 5.
diff --git a/test/functional/editor/langmap_spec.lua b/test/functional/editor/langmap_spec.lua
index 5ad81ce5c2..b2a4b21a89 100644
--- a/test/functional/editor/langmap_spec.lua
+++ b/test/functional/editor/langmap_spec.lua
@@ -4,7 +4,7 @@ local eq, neq, call = helpers.eq, helpers.neq, helpers.call
local eval, feed, clear = helpers.eval, helpers.feed, helpers.clear
local command, insert, expect = helpers.command, helpers.insert, helpers.expect
local feed_command = helpers.feed_command
-local curwin = helpers.meths.nvim_get_current_win
+local curwin = helpers.api.nvim_get_current_win
describe("'langmap'", function()
before_each(function()
@@ -215,7 +215,7 @@ describe("'langmap'", function()
feed('qa' .. command_string .. 'q')
expect(expect_string)
eq(
- expect_macro or helpers.funcs.nvim_replace_termcodes(command_string, true, true, true),
+ expect_macro or helpers.fn.nvim_replace_termcodes(command_string, true, true, true),
eval('@a')
)
if setup_function then
diff --git a/test/functional/editor/macro_spec.lua b/test/functional/editor/macro_spec.lua
index 1d2df8ce70..c97befdf07 100644
--- a/test/functional/editor/macro_spec.lua
+++ b/test/functional/editor/macro_spec.lua
@@ -6,8 +6,8 @@ local feed = helpers.feed
local clear = helpers.clear
local expect = helpers.expect
local command = helpers.command
-local funcs = helpers.funcs
-local meths = helpers.meths
+local fn = helpers.fn
+local api = helpers.api
local insert = helpers.insert
describe('macros', function()
@@ -40,18 +40,18 @@ hello]]
feed [[gg]]
feed [[qqAFOO<esc>q]]
- eq({ 'helloFOO', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[Q]]
- eq({ 'helloFOOFOO', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOOFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[G3Q]]
- eq({ 'helloFOOFOO', 'hello', 'helloFOOFOOFOO' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOOFOO', 'hello', 'helloFOOFOOFOO' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[ggV3jQ]]
eq(
{ 'helloFOOFOOFOO', 'helloFOO', 'helloFOOFOOFOOFOO' },
- meths.nvim_buf_get_lines(0, 0, -1, false)
+ api.nvim_buf_get_lines(0, 0, -1, false)
)
end)
@@ -62,18 +62,18 @@ hello]]
feed [[gg]]
feed [[qqAFOO<esc>q]]
- eq({ 'helloFOO', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[Q]]
- eq({ 'helloFOOFOO', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOOFOO', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[G3@@]]
- eq({ 'helloFOOFOO', 'hello', 'helloFOOFOOFOO' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOOFOO', 'hello', 'helloFOOFOOFOO' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[ggV2j@@]]
eq(
{ 'helloFOOFOOFOO', 'helloFOO', 'helloFOOFOOFOOFOO' },
- meths.nvim_buf_get_lines(0, 0, -1, false)
+ api.nvim_buf_get_lines(0, 0, -1, false)
)
end)
@@ -84,17 +84,17 @@ hello]]
feed [[gg]]
feed [[qqAFOO<esc>qu]]
- eq({ 'hello', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[qwA123<esc>qu]]
- eq({ 'hello', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[V3j@q]]
- eq({ 'helloFOO', 'helloFOO', 'helloFOO' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOO', 'helloFOO', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[gg]]
feed [[Vj@w]]
- eq({ 'helloFOO123', 'helloFOO123', 'helloFOO' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOO123', 'helloFOO123', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false))
end)
it('can be replayed with @q and @w visual-block', function()
@@ -104,17 +104,17 @@ hello]]
feed [[gg]]
feed [[qqAFOO<esc>qu]]
- eq({ 'hello', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[qwA123<esc>qu]]
- eq({ 'hello', 'hello', 'hello' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'hello', 'hello', 'hello' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[<C-v>3j@q]]
- eq({ 'helloFOO', 'helloFOO', 'helloFOO' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOO', 'helloFOO', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false))
feed [[gg]]
feed [[<C-v>j@w]]
- eq({ 'helloFOO123', 'helloFOO123', 'helloFOO' }, meths.nvim_buf_get_lines(0, 0, -1, false))
+ eq({ 'helloFOO123', 'helloFOO123', 'helloFOO' }, api.nvim_buf_get_lines(0, 0, -1, false))
end)
end)
@@ -127,13 +127,13 @@ describe('immediately after a macro has finished executing,', function()
describe('reg_executing() from RPC returns an empty string', function()
it('if the macro does not end with a <Nop> mapping', function()
feed('@a')
- eq('', funcs.reg_executing())
+ eq('', fn.reg_executing())
end)
it('if the macro ends with a <Nop> mapping', function()
command('nnoremap 0 <Nop>')
feed('@a')
- eq('', funcs.reg_executing())
+ eq('', fn.reg_executing())
end)
end)
@@ -144,7 +144,7 @@ describe('immediately after a macro has finished executing,', function()
it('if the macro does not end with a <Nop> mapping', function()
feed('@asq') -- "q" from "s" mapping should start recording a macro instead of being no-op
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
expect('')
eq('', eval('@a'))
end)
@@ -152,7 +152,7 @@ describe('immediately after a macro has finished executing,', function()
it('if the macro ends with a <Nop> mapping', function()
command('nnoremap 0 <Nop>')
feed('@asq') -- "q" from "s" mapping should start recording a macro instead of being no-op
- eq({ mode = 'n', blocking = false }, meths.nvim_get_mode())
+ eq({ mode = 'n', blocking = false }, api.nvim_get_mode())
expect('')
eq('', eval('@a'))
end)
diff --git a/test/functional/editor/mark_spec.lua b/test/functional/editor/mark_spec.lua
index 67234b9b90..de905a86ba 100644
--- a/test/functional/editor/mark_spec.lua
+++ b/test/functional/editor/mark_spec.lua
@@ -1,15 +1,15 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
-local meths = helpers.meths
+local api = helpers.api
local clear = helpers.clear
local command = helpers.command
-local funcs = helpers.funcs
+local fn = helpers.fn
local eq = helpers.eq
local feed = helpers.feed
local write_file = helpers.write_file
local pcall_err = helpers.pcall_err
local cursor = function()
- return helpers.meths.nvim_win_get_cursor(0)
+ return helpers.api.nvim_win_get_cursor(0)
end
describe('named marks', function()
@@ -28,13 +28,13 @@ describe('named marks', function()
it('can be set', function()
command('edit ' .. file1)
command('mark a')
- eq({ 1, 0 }, meths.nvim_buf_get_mark(0, 'a'))
+ eq({ 1, 0 }, api.nvim_buf_get_mark(0, 'a'))
feed('jmb')
- eq({ 2, 0 }, meths.nvim_buf_get_mark(0, 'b'))
+ eq({ 2, 0 }, api.nvim_buf_get_mark(0, 'b'))
feed('jmB')
- eq({ 3, 0 }, meths.nvim_buf_get_mark(0, 'B'))
+ eq({ 3, 0 }, api.nvim_buf_get_mark(0, 'B'))
command('4kc')
- eq({ 4, 0 }, meths.nvim_buf_get_mark(0, 'c'))
+ eq({ 4, 0 }, api.nvim_buf_get_mark(0, 'c'))
end)
it('errors when set out of range with :mark', function()
@@ -104,7 +104,7 @@ describe('named marks', function()
feed('mA')
command('next')
feed("'A")
- eq(1, meths.nvim_get_current_buf().id)
+ eq(1, api.nvim_get_current_buf().id)
eq({ 2, 0 }, cursor())
end)
@@ -117,7 +117,7 @@ describe('named marks', function()
feed('mA')
command('next')
feed('`A')
- eq(1, meths.nvim_get_current_buf().id)
+ eq(1, api.nvim_get_current_buf().id)
eq({ 2, 2 }, cursor())
end)
@@ -130,7 +130,7 @@ describe('named marks', function()
feed('mA')
command('next')
feed("g'A")
- eq(1, meths.nvim_get_current_buf().id)
+ eq(1, api.nvim_get_current_buf().id)
eq({ 2, 0 }, cursor())
end)
@@ -143,7 +143,7 @@ describe('named marks', function()
feed('mA')
command('next')
feed('g`A')
- eq(1, meths.nvim_get_current_buf().id)
+ eq(1, api.nvim_get_current_buf().id)
eq({ 2, 2 }, cursor())
end)
@@ -157,7 +157,7 @@ describe('named marks', function()
feed('mA')
command('next')
command("'A")
- eq(1, meths.nvim_get_current_buf().id)
+ eq(1, api.nvim_get_current_buf().id)
eq({ 2, 0 }, cursor())
end)
@@ -267,59 +267,59 @@ describe('named marks', function()
feed('jzfG') -- Fold from the second line to the end
command('3mark a')
feed('G') -- On top of the fold
- assert(funcs.foldclosed('.') ~= -1) -- folded
+ assert(fn.foldclosed('.') ~= -1) -- folded
feed("'a")
- eq(-1, funcs.foldclosed('.'))
+ eq(-1, fn.foldclosed('.'))
feed('zc')
- assert(funcs.foldclosed('.') ~= -1) -- folded
+ assert(fn.foldclosed('.') ~= -1) -- folded
-- TODO: remove this workaround after fixing #15873
feed('k`a')
- eq(-1, funcs.foldclosed('.'))
+ eq(-1, fn.foldclosed('.'))
feed('zc')
- assert(funcs.foldclosed('.') ~= -1) -- folded
+ assert(fn.foldclosed('.') ~= -1) -- folded
feed("kg'a")
- eq(-1, funcs.foldclosed('.'))
+ eq(-1, fn.foldclosed('.'))
feed('zc')
- assert(funcs.foldclosed('.') ~= -1) -- folded
+ assert(fn.foldclosed('.') ~= -1) -- folded
feed('kg`a')
- eq(-1, funcs.foldclosed('.'))
+ eq(-1, fn.foldclosed('.'))
end)
it("do not open folds when moving to them doesn't move the cursor", function()
command('edit ' .. file1)
feed('jzfG') -- Fold from the second line to the end
- assert(funcs.foldclosed('.') == 2) -- folded
+ assert(fn.foldclosed('.') == 2) -- folded
feed('ma')
feed("'a")
feed('`a')
feed("g'a")
feed('g`a')
-- should still be folded
- eq(2, funcs.foldclosed('.'))
+ eq(2, fn.foldclosed('.'))
end)
it("getting '{ '} '( ') does not move cursor", function()
- 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.nvim_win_get_cursor(0))
- funcs.getpos("'}")
- eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
- funcs.getpos("'(")
- eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
- funcs.getpos("')")
- eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
+ api.nvim_buf_set_lines(0, 0, 0, true, { 'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee' })
+ api.nvim_win_set_cursor(0, { 2, 0 })
+ fn.getpos("'{")
+ eq({ 2, 0 }, api.nvim_win_get_cursor(0))
+ fn.getpos("'}")
+ eq({ 2, 0 }, api.nvim_win_get_cursor(0))
+ fn.getpos("'(")
+ eq({ 2, 0 }, api.nvim_win_get_cursor(0))
+ fn.getpos("')")
+ eq({ 2, 0 }, api.nvim_win_get_cursor(0))
end)
it('in command range does not move cursor #19248', function()
- 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 })
+ api.nvim_create_user_command('Test', ':', { range = true })
+ api.nvim_buf_set_lines(0, 0, 0, true, { 'aaaaa', 'bbbbb', 'ccccc', 'ddddd', 'eeeee' })
+ api.nvim_win_set_cursor(0, { 2, 0 })
command([['{,'}Test]])
- eq({ 2, 0 }, meths.nvim_win_get_cursor(0))
+ eq({ 2, 0 }, api.nvim_win_get_cursor(0))
end)
end)
diff --git a/test/functional/editor/meta_key_spec.lua b/test/functional/editor/meta_key_spec.lua
index 3b66c8fc05..b57f5c3c35 100644
--- a/test/functional/editor/meta_key_spec.lua
+++ b/test/functional/editor/meta_key_spec.lua
@@ -4,7 +4,7 @@ local command = helpers.command
local exec_lua = helpers.exec_lua
local eval = helpers.eval
local expect = helpers.expect
-local funcs = helpers.funcs
+local fn = helpers.fn
local eq = helpers.eq
describe('meta-keys #8226 #13042', function()
@@ -66,11 +66,11 @@ describe('meta-keys #8226 #13042', function()
command('inoremap <A-j> alt-j')
feed('i<M-l> xxx <A-j><M-h>a<A-h>')
expect('meta-l xxx alt-j')
- eq({ 0, 1, 14, 0 }, funcs.getpos('.'))
+ eq({ 0, 1, 14, 0 }, fn.getpos('.'))
-- Unmapped ALT-chord behaves as ESC+c.
command('iunmap <M-l>')
feed('0i<M-l>')
- eq({ 0, 1, 2, 0 }, funcs.getpos('.'))
+ eq({ 0, 1, 2, 0 }, fn.getpos('.'))
-- Unmapped ALT-chord has same `undo` characteristics as ESC+<key>
command('0,$d')
feed('ahello<M-.>')
@@ -101,7 +101,7 @@ describe('meta-keys #8226 #13042', function()
eq(meta_l_seq .. 'yyy' .. meta_l_seq .. 'alt-j', exec_lua([[return _G.input_data]]))
eq('t', eval('mode(1)'))
feed('<Esc>j')
- eq({ 0, 2, 1, 0 }, funcs.getpos('.'))
+ eq({ 0, 2, 1, 0 }, fn.getpos('.'))
eq('nt', eval('mode(1)'))
end)
diff --git a/test/functional/editor/mode_cmdline_spec.lua b/test/functional/editor/mode_cmdline_spec.lua
index 2aa4542cb7..06efe53718 100644
--- a/test/functional/editor/mode_cmdline_spec.lua
+++ b/test/functional/editor/mode_cmdline_spec.lua
@@ -2,11 +2,11 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, insert, funcs, eq, feed =
- helpers.clear, helpers.insert, helpers.funcs, helpers.eq, helpers.feed
+local clear, insert, fn, eq, feed =
+ helpers.clear, helpers.insert, helpers.fn, helpers.eq, helpers.feed
local eval = helpers.eval
local command = helpers.command
-local meths = helpers.meths
+local api = helpers.api
describe('cmdline', function()
before_each(clear)
@@ -20,22 +20,22 @@ describe('cmdline', function()
-- Yank 2 lines linewise, then paste to cmdline.
feed([[<C-\><C-N>gg0yj:<C-R>0]])
-- <CR> inserted between lines, NOT after the final line.
- eq('line1abc\rline2somemoretext', funcs.getcmdline())
+ eq('line1abc\rline2somemoretext', fn.getcmdline())
-- Yank 2 lines charwise, then paste to cmdline.
feed([[<C-\><C-N>gg05lyvj:<C-R>0]])
-- <CR> inserted between lines, NOT after the final line.
- eq('abc\rline2', funcs.getcmdline())
+ eq('abc\rline2', fn.getcmdline())
-- Yank 1 line linewise, then paste to cmdline.
feed([[<C-\><C-N>ggyy:<C-R>0]])
-- No <CR> inserted.
- eq('line1abc', funcs.getcmdline())
+ eq('line1abc', fn.getcmdline())
end)
it('pasting special register inserts <CR>, <NL>', function()
feed([[:<C-R>="foo\nbar\rbaz"<CR>]])
- eq('foo\nbar\rbaz', funcs.getcmdline())
+ eq('foo\nbar\rbaz', fn.getcmdline())
end)
end)
@@ -77,30 +77,30 @@ describe('cmdline', function()
it('correctly clears start of the history', function()
-- Regression test: check absence of the memory leak when clearing start of
-- the history using cmdhist.c/clr_history().
- eq(1, funcs.histadd(':', 'foo'))
- eq(1, funcs.histdel(':'))
- eq('', funcs.histget(':', -1))
+ eq(1, fn.histadd(':', 'foo'))
+ eq(1, fn.histdel(':'))
+ eq('', fn.histget(':', -1))
end)
it('correctly clears end of the history', function()
-- Regression test: check absence of the memory leak when clearing end of
-- the history using cmdhist.c/clr_history().
- meths.nvim_set_option_value('history', 1, {})
- eq(1, funcs.histadd(':', 'foo'))
- eq(1, funcs.histdel(':'))
- eq('', funcs.histget(':', -1))
+ api.nvim_set_option_value('history', 1, {})
+ eq(1, fn.histadd(':', 'foo'))
+ eq(1, fn.histdel(':'))
+ eq('', fn.histget(':', -1))
end)
it('correctly removes item from history', function()
-- Regression test: check that cmdhist.c/del_history_idx() correctly clears
-- history index after removing history entry. If it does not then deleting
-- history will result in a double free.
- eq(1, funcs.histadd(':', 'foo'))
- eq(1, funcs.histadd(':', 'bar'))
- eq(1, funcs.histadd(':', 'baz'))
- eq(1, funcs.histdel(':', -2))
- eq(1, funcs.histdel(':'))
- eq('', funcs.histget(':', -1))
+ eq(1, fn.histadd(':', 'foo'))
+ eq(1, fn.histadd(':', 'bar'))
+ eq(1, fn.histadd(':', 'baz'))
+ eq(1, fn.histdel(':', -2))
+ eq(1, fn.histdel(':'))
+ eq('', fn.histget(':', -1))
end)
end)
end)
diff --git a/test/functional/editor/put_spec.lua b/test/functional/editor/put_spec.lua
index da9ba49aa5..414b289222 100644
--- a/test/functional/editor/put_spec.lua
+++ b/test/functional/editor/put_spec.lua
@@ -11,7 +11,7 @@ local filter = vim.tbl_filter
local feed_command = helpers.feed_command
local command = helpers.command
local curbuf_contents = helpers.curbuf_contents
-local funcs = helpers.funcs
+local fn = helpers.fn
local dedent = helpers.dedent
local function reset()
@@ -21,9 +21,9 @@ local function reset()
Line of words 2]])
command('goto 1')
feed('itest_string.<esc>u')
- funcs.setreg('a', 'test_stringa', 'V')
- funcs.setreg('b', 'test_stringb\ntest_stringb\ntest_stringb', 'b')
- funcs.setreg('"', 'test_string"', 'v')
+ fn.setreg('a', 'test_stringa', 'V')
+ fn.setreg('b', 'test_stringb\ntest_stringb\ntest_stringb', 'b')
+ fn.setreg('"', 'test_string"', 'v')
end
-- We check the last inserted register ". in each of these tests because it is
@@ -35,12 +35,12 @@ describe('put command', function()
before_each(reset)
local function visual_marks_zero()
- for _, v in pairs(funcs.getpos("'<")) do
+ for _, v in pairs(fn.getpos("'<")) do
if v ~= 0 then
return false
end
end
- for _, v in pairs(funcs.getpos("'>")) do
+ for _, v in pairs(fn.getpos("'>")) do
if v ~= 0 then
return false
end
@@ -55,7 +55,7 @@ describe('put command', function()
extra_setup()
end
local init_contents = curbuf_contents()
- local init_cursorpos = funcs.getcurpos()
+ local init_cursorpos = fn.getcurpos()
local assert_no_change = function(exception_table, after_undo)
expect(init_contents)
-- When putting the ". register forwards, undo doesn't move
@@ -65,7 +65,7 @@ describe('put command', function()
-- one place to the right (unless we were at the end of the
-- line when we pasted).
if not (exception_table.undo_position and after_undo) then
- eq(init_cursorpos, funcs.getcurpos())
+ eq(init_cursorpos, fn.getcurpos())
end
end
@@ -74,7 +74,7 @@ describe('put command', function()
if extra_setup then
extra_setup()
end
- local orig_dotstr = funcs.getreg('.')
+ local orig_dotstr = fn.getreg('.')
helpers.ok(visual_marks_zero())
-- Make sure every test starts from the same conditions
assert_no_change(test.exception_table, false)
@@ -89,7 +89,7 @@ describe('put command', function()
-- If we paste the ". register with a count we can't avoid
-- changing this register, hence avoid this check.
if not test.exception_table.dot_reg_changed then
- eq(orig_dotstr, funcs.getreg('.'))
+ eq(orig_dotstr, fn.getreg('.'))
end
-- Doing something, undoing it, and then redoing it should
@@ -105,7 +105,7 @@ describe('put command', function()
end
if test.exception_table.undo_position then
- funcs.setpos('.', init_cursorpos)
+ fn.setpos('.', init_cursorpos)
end
if was_cli then
feed('@:')
@@ -151,7 +151,7 @@ describe('put command', function()
-- it was in.
-- This returns the cursor position that would leave the 'x' in that
-- place if we feed 'ix<esc>' and the string existed before it.
- for linenum, line in pairs(funcs.split(expect_string, '\n', 1)) do
+ for linenum, line in pairs(fn.split(expect_string, '\n', 1)) do
local column = line:find('x')
if column then
return { linenum, column }, expect_string:gsub('x', '')
@@ -184,16 +184,16 @@ describe('put command', function()
return function(exception_table, after_redo)
expect(expect_string)
- -- Have to use getcurpos() instead of meths.nvim_win_get_cursor(0) in
+ -- Have to use getcurpos() instead of api.nvim_win_get_cursor(0) in
-- order to account for virtualedit.
-- We always want the curswant element in getcurpos(), which is
-- sometimes different to the column element in
- -- meths.nvim_win_get_cursor(0).
+ -- api.nvim_win_get_cursor(0).
-- NOTE: The ".gp command leaves the cursor after the pasted text
-- when running, but does not when the command is redone with the
-- '.' command.
if not (exception_table.redo_position and after_redo) then
- local actual_position = funcs.getcurpos()
+ local actual_position = fn.getcurpos()
eq(cursor_position, { actual_position[2], actual_position[5] })
end
end
@@ -349,7 +349,7 @@ describe('put command', function()
local prev_line
local rettab = {}
local string_found = false
- for _, line in pairs(funcs.split(string, '\n', 1)) do
+ for _, line in pairs(fn.split(string, '\n', 1)) do
if line:find('test_string') then
string_found = true
table.insert(rettab, line)
@@ -476,7 +476,7 @@ describe('put command', function()
local prev_line
local rettab = {}
local prev_in_block = false
- for _, line in pairs(funcs.split(expect_base, '\n', 1)) do
+ for _, line in pairs(fn.split(expect_base, '\n', 1)) do
if line:find('test_string') then
if prev_line then
prev_line = prev_line:gsub('x', '')
@@ -524,10 +524,10 @@ describe('put command', function()
test_expect(exception_table, after_redo)
if selection_string then
if not conversion_table.put_backwards then
- eq(selection_string, funcs.getreg('"'))
+ eq(selection_string, fn.getreg('"'))
end
else
- eq('test_string"', funcs.getreg('"'))
+ eq('test_string"', fn.getreg('"'))
end
end
end
@@ -657,10 +657,10 @@ describe('put command', function()
xtest_string"]],
'put',
function()
- funcs.setline('$', ' Line of words 2')
+ fn.setline('$', ' Line of words 2')
-- Set curswant to '8' to be at the end of the tab character
-- This is where the cursor is put back after the 'u' command.
- funcs.setpos('.', { 0, 2, 1, 0, 8 })
+ fn.setpos('.', { 0, 2, 1, 0, 8 })
command('set autoindent')
end
)
@@ -671,9 +671,9 @@ describe('put command', function()
Line of words 1
test_stringx" Line of words 2]]
run_normal_mode_tests(test_string, 'p', function()
- funcs.setline('$', ' Line of words 2')
+ fn.setline('$', ' Line of words 2')
command('setlocal virtualedit=all')
- funcs.setpos('.', { 0, 2, 1, 2, 3 })
+ fn.setpos('.', { 0, 2, 1, 2, 3 })
end)
end)
@@ -683,9 +683,9 @@ describe('put command', function()
Line of words 1 test_stringx"
Line of words 2]]
run_normal_mode_tests(test_string, 'p', function()
- funcs.setline('$', ' Line of words 2')
+ fn.setline('$', ' Line of words 2')
command('setlocal virtualedit=all')
- funcs.setpos('.', { 0, 1, 16, 1, 17 })
+ fn.setpos('.', { 0, 1, 16, 1, 17 })
end, true)
end)
@@ -699,7 +699,7 @@ describe('put command', function()
describe('over trailing newline', function()
local test_string = 'Line of test_stringx"Line of words 2'
run_normal_mode_tests(test_string, 'v$p', function()
- funcs.setpos('.', { 0, 1, 9, 0, 9 })
+ fn.setpos('.', { 0, 1, 9, 0, 9 })
end, nil, 'words 1\n')
end)
describe('linewise mode', function()
@@ -720,7 +720,7 @@ describe('put command', function()
expect_vis_linewise
),
function()
- funcs.setpos('.', { 0, 1, 1, 0, 1 })
+ fn.setpos('.', { 0, 1, 1, 0, 1 })
end
)
@@ -732,7 +732,7 @@ describe('put command', function()
return function(exception_table, after_redo)
test_expect(exception_table, after_redo)
if not conversion_table.put_backwards then
- eq('Line of words 1\n', funcs.getreg('"'))
+ eq('Line of words 1\n', fn.getreg('"'))
end
end
end
@@ -749,7 +749,7 @@ describe('put command', function()
),
function()
feed('i test_string.<esc>u')
- funcs.setreg('"', ' test_string"', 'v')
+ fn.setreg('"', ' test_string"', 'v')
end
)
end)
@@ -767,7 +767,7 @@ describe('put command', function()
return function(e, c)
test_expect(e, c)
if not conversion_table.put_backwards then
- eq('Lin\nLin', funcs.getreg('"'))
+ eq('Lin\nLin', fn.getreg('"'))
end
end
end
@@ -804,7 +804,7 @@ describe('put command', function()
expect_block_creator
),
function()
- funcs.setpos('.', { 0, 2, 1, 0, 1 })
+ fn.setpos('.', { 0, 2, 1, 0, 1 })
end
)
@@ -820,16 +820,16 @@ describe('put command', function()
feed('u')
-- Have to use feed('u') here to set curswant, because
-- ex_undo() doesn't do that.
- eq({ 0, 1, 1, 0, 1 }, funcs.getcurpos())
+ eq({ 0, 1, 1, 0, 1 }, fn.getcurpos())
feed('<C-r>')
- eq({ 0, 1, 1, 0, 1 }, funcs.getcurpos())
+ eq({ 0, 1, 1, 0, 1 }, fn.getcurpos())
end
end
run_test_variations(
create_test_defs(undo_redo_no, '<C-v>kllp', create_p_action, test_base, assertion_creator),
function()
- funcs.setpos('.', { 0, 2, 1, 0, 1 })
+ fn.setpos('.', { 0, 2, 1, 0, 1 })
end
)
end)
@@ -841,9 +841,9 @@ describe('put command', function()
Line of words 1
test_stringx" Line of words 2]]
run_normal_mode_tests(base_expect_string, 'vp', function()
- funcs.setline('$', ' Line of words 2')
+ fn.setline('$', ' Line of words 2')
command('setlocal virtualedit=all')
- funcs.setpos('.', { 0, 2, 1, 2, 3 })
+ fn.setpos('.', { 0, 2, 1, 2, 3 })
end, nil, ' ')
end)
describe('after end of line', function()
@@ -852,7 +852,7 @@ describe('put command', function()
Line of words 2]]
run_normal_mode_tests(base_expect_string, 'vp', function()
command('setlocal virtualedit=all')
- funcs.setpos('.', { 0, 1, 16, 2, 18 })
+ fn.setpos('.', { 0, 1, 16, 2, 18 })
end, true, ' ')
end)
end)
@@ -917,14 +917,14 @@ describe('put command', function()
-- Even if the last character is a multibyte character.
reset()
- funcs.setline(1, 'helloม')
+ fn.setline(1, 'helloม')
bell_test(function()
feed('$".gp')
end)
end)
it('should not ring the bell with gp and end of file', function()
- funcs.setpos('.', { 0, 2, 1, 0 })
+ fn.setpos('.', { 0, 2, 1, 0 })
bell_test(function()
feed('$vl".gp')
end)
@@ -942,9 +942,9 @@ describe('put command', function()
end)
it('should restore cursor position after undo of ".p', function()
- local origpos = funcs.getcurpos()
+ local origpos = fn.getcurpos()
feed('".pu')
- eq(origpos, funcs.getcurpos())
+ eq(origpos, fn.getcurpos())
end)
it("should be unaffected by 'autoindent' with V\".2p", function()
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua
index 2087695465..f64e099344 100644
--- a/test/functional/editor/tabpage_spec.lua
+++ b/test/functional/editor/tabpage_spec.lua
@@ -8,9 +8,9 @@ local neq = helpers.neq
local feed = helpers.feed
local eval = helpers.eval
local exec = helpers.exec
-local funcs = helpers.funcs
-local meths = helpers.meths
-local curwin = helpers.meths.nvim_get_current_win
+local fn = helpers.fn
+local api = helpers.api
+local curwin = helpers.api.nvim_get_current_win
local assert_alive = helpers.assert_alive
describe('tabpage', function()
@@ -74,29 +74,29 @@ describe('tabpage', function()
end)
it('nvim_win_close and nvim_win_hide update tabline #20285', function()
- eq(1, #meths.nvim_list_tabpages())
- eq({ 1, 1 }, funcs.win_screenpos(0))
+ eq(1, #api.nvim_list_tabpages())
+ eq({ 1, 1 }, fn.win_screenpos(0))
local win1 = curwin().id
command('tabnew')
- eq(2, #meths.nvim_list_tabpages())
- eq({ 2, 1 }, funcs.win_screenpos(0))
+ eq(2, #api.nvim_list_tabpages())
+ eq({ 2, 1 }, fn.win_screenpos(0))
local win2 = curwin().id
- meths.nvim_win_close(win1, true)
+ api.nvim_win_close(win1, true)
eq(win2, curwin().id)
- eq(1, #meths.nvim_list_tabpages())
- eq({ 1, 1 }, funcs.win_screenpos(0))
+ eq(1, #api.nvim_list_tabpages())
+ eq({ 1, 1 }, fn.win_screenpos(0))
command('tabnew')
- eq(2, #meths.nvim_list_tabpages())
- eq({ 2, 1 }, funcs.win_screenpos(0))
+ eq(2, #api.nvim_list_tabpages())
+ eq({ 2, 1 }, fn.win_screenpos(0))
local win3 = curwin().id
- meths.nvim_win_hide(win2)
+ api.nvim_win_hide(win2)
eq(win3, curwin().id)
- eq(1, #meths.nvim_list_tabpages())
- eq({ 1, 1 }, funcs.win_screenpos(0))
+ eq(1, #api.nvim_list_tabpages())
+ eq({ 1, 1 }, fn.win_screenpos(0))
end)
it('switching tabpage after setting laststatus=3 #19591', function()
@@ -135,15 +135,15 @@ describe('tabpage', function()
it(':tabmove handles modifiers and addr', function()
command('tabnew | tabnew | tabnew')
- eq(4, funcs.nvim_tabpage_get_number(0))
+ eq(4, fn.nvim_tabpage_get_number(0))
command(' silent :keepalt :: ::: silent! - tabmove')
- eq(3, funcs.nvim_tabpage_get_number(0))
+ eq(3, fn.nvim_tabpage_get_number(0))
command(' silent :keepalt :: ::: silent! -2 tabmove')
- eq(1, funcs.nvim_tabpage_get_number(0))
+ eq(1, fn.nvim_tabpage_get_number(0))
end)
it(':tabs does not overflow IObuff with long path with comma #20850', function()
- meths.nvim_buf_set_name(0, ('x'):rep(1024) .. ',' .. ('x'):rep(1024))
+ api.nvim_buf_set_name(0, ('x'):rep(1024) .. ',' .. ('x'):rep(1024))
command('tabs')
assert_alive()
end)
diff --git a/test/functional/editor/undo_spec.lua b/test/functional/editor/undo_spec.lua
index a2dc34a6b9..c101bf02a0 100644
--- a/test/functional/editor/undo_spec.lua
+++ b/test/functional/editor/undo_spec.lua
@@ -8,12 +8,12 @@ local eq = helpers.eq
local feed = helpers.feed
local feed_command = helpers.feed_command
local insert = helpers.insert
-local funcs = helpers.funcs
+local fn = helpers.fn
local exec = helpers.exec
local exec_lua = helpers.exec_lua
local function lastmessage()
- local messages = funcs.split(funcs.execute('messages'), '\n')
+ local messages = fn.split(fn.execute('messages'), '\n')
return messages[#messages]
end