diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-05 22:37:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-05 22:37:39 +0200 |
commit | 401f0c07982247cc6d1cd22be08b05c44f7fd040 (patch) | |
tree | 2fd536d4d42da3660cc2871a30be7bdb2c34c9f5 | |
parent | 4b9bd692bdffba03fda04f9979e25431b53e416b (diff) | |
download | vim-git-401f0c07982247cc6d1cd22be08b05c44f7fd040.tar.gz |
patch 8.2.1618: Vim9: cannot pass "true" to setloclist()v8.2.1618
Problem: Vim9: cannot pass "true" to setloclist().
Solution: Use dict_get_bool(). (closes #6882)
-rw-r--r-- | src/quickfix.c | 2 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 09d5d8fa0..c8858b456 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -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 diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 3fb84022f..47c37f0bd 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -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') diff --git a/src/version.c b/src/version.c index d4224657f..5beab6d95 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1618, +/**/ 1617, /**/ 1616, |