mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
vim-patch:7.4.2200
Problem: Cannot get all information about a quickfix list.
Solution: Add an optional argument to get/set loc/qf list(). (Yegappan
Lakshmanan)
d823fa910c
This commit is contained in:
@@ -27,20 +27,18 @@ describe('setqflist()', function()
|
||||
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'))
|
||||
end)
|
||||
|
||||
it('requires string or number for {title}', function()
|
||||
command('copen')
|
||||
it('allows string {what} for backwards compatibility', function()
|
||||
setqflist({}, 'r', '5')
|
||||
command('copen')
|
||||
eq(':5', get_cur_win_var('quickfix_title'))
|
||||
setqflist({}, 'r', 6)
|
||||
eq(':6', get_cur_win_var('quickfix_title'))
|
||||
local exc = exc_exec('call setqflist([], "r", function("function"))')
|
||||
eq('Vim(call):E729: using Funcref as a String', exc)
|
||||
exc = exc_exec('call setqflist([], "r", [])')
|
||||
eq('Vim(call):E730: using List as a String', exc)
|
||||
exc = exc_exec('call setqflist([], "r", {})')
|
||||
eq('Vim(call):E731: using Dictionary as a String', exc)
|
||||
end)
|
||||
|
||||
it('requires a dict for {what}', function()
|
||||
eq('Vim(call):E715: Dictionary required', exc_exec('call setqflist([], "r", function("function"))'))
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user