aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/errorlist_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/vimscript/errorlist_spec.lua')
-rw-r--r--test/functional/vimscript/errorlist_spec.lua33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/functional/vimscript/errorlist_spec.lua b/test/functional/vimscript/errorlist_spec.lua
index 077d816903..1e405e7e64 100644
--- a/test/functional/vimscript/errorlist_spec.lua
+++ b/test/functional/vimscript/errorlist_spec.lua
@@ -4,10 +4,10 @@ local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
local exc_exec = helpers.exc_exec
-local get_cur_win_var = helpers.curwinmeths.get_var
+local get_win_var = helpers.api.nvim_win_get_var
describe('setqflist()', function()
- local setqflist = helpers.funcs.setqflist
+ local setqflist = helpers.fn.setqflist
before_each(clear)
@@ -24,26 +24,29 @@ describe('setqflist()', function()
end)
it('sets w:quickfix_title', function()
- setqflist({''}, 'r', 'foo')
+ setqflist({ '' }, 'r', 'foo')
command('copen')
- eq('foo', get_cur_win_var('quickfix_title'))
- setqflist({}, 'r', {['title'] = 'qf_title'})
- eq('qf_title', get_cur_win_var('quickfix_title'))
+ eq('foo', get_win_var(0, 'quickfix_title'))
+ setqflist({}, 'r', { ['title'] = 'qf_title' })
+ eq('qf_title', get_win_var(0, 'quickfix_title'))
end)
it('allows string {what} for backwards compatibility', function()
setqflist({}, 'r', '5')
command('copen')
- eq('5', get_cur_win_var('quickfix_title'))
+ eq('5', get_win_var(0, 'quickfix_title'))
end)
it('requires a dict for {what}', function()
- eq('Vim(call):E715: Dictionary required', exc_exec('call setqflist([], "r", function("function"))'))
+ eq(
+ 'Vim(call):E715: Dictionary required',
+ exc_exec('call setqflist([], "r", function("function"))')
+ )
end)
end)
describe('setloclist()', function()
- local setloclist = helpers.funcs.setloclist
+ local setloclist = helpers.fn.setloclist
before_each(clear)
@@ -64,20 +67,20 @@ describe('setloclist()', function()
setloclist(1, {}, 'r', 'foo')
setloclist(2, {}, 'r', 'bar')
command('lopen')
- eq('bar', get_cur_win_var('quickfix_title'))
+ eq('bar', get_win_var(0, 'quickfix_title'))
command('lclose | wincmd w | lopen')
- eq('foo', get_cur_win_var('quickfix_title'))
+ eq('foo', get_win_var(0, 'quickfix_title'))
end)
it("doesn't crash when when window is closed in the middle #13721", function()
helpers.insert([[
hello world]])
- command("vsplit")
- command("autocmd WinLeave * :call nvim_win_close(0, v:true)")
+ command('vsplit')
+ command('autocmd WinLeave * :call nvim_win_close(0, v:true)')
- command("call setloclist(0, [])")
- command("lopen")
+ command('call setloclist(0, [])')
+ command('lopen')
helpers.assert_alive()
end)