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:
James McCoy
2017-02-27 09:52:03 -05:00
parent be65fd88f4
commit c9c3f92b49
8 changed files with 322 additions and 77 deletions

View File

@@ -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)