0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.1618: Vim9: cannot pass "true" to setloclist()

Problem:    Vim9: cannot pass "true" to setloclist().
Solution:   Use dict_get_bool(). (closes #6882)
This commit is contained in:
Bram Moolenaar 2020-09-05 22:37:39 +02:00
parent 4b9bd692bd
commit 401f0c0798
3 changed files with 10 additions and 1 deletions

View File

@ -7072,7 +7072,7 @@ qf_add_entry_from_dict(
// If the 'valid' field is present it overrules the detected value.
if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
valid = (int)dict_get_number(d, (char_u *)"valid");
valid = (int)dict_get_bool(d, (char_u *)"valid", FALSE);
status = qf_add_entry(qfl,
NULL, // dir

View File

@ -1614,6 +1614,13 @@ def Test_setbufvar()
assert_equal(123, getbufvar('%', 'myvar'))
enddef
def Test_setloclist()
let items = [#{filename: '/tmp/file', lnum: 1, valid: true}]
let what = #{items: items}
setqflist([], ' ', what)
setloclist(0, [], ' ', what)
enddef
def Test_setreg()
setreg('a', ['aaa', 'bbb', 'ccc'])
let reginfo = getreginfo('a')

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1618,
/**/
1617,
/**/