Patch 8.2.1618

5 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 5, 2020, 4:38:23 PM9/5/20
to vim...@googlegroups.com

Patch 8.2.1618
Problem: Vim9: cannot pass "true" to setloclist().
Solution: Use dict_get_bool(). (closes #6882)
Files: src/quickfix.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1617/src/quickfix.c 2020-09-05 17:03:31.923261682 +0200
--- src/quickfix.c 2020-09-05 22:34:19.670484197 +0200
***************
*** 7072,7078 ****

// 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");

status = qf_add_entry(qfl,
NULL, // dir
--- 7072,7078 ----

// If the 'valid' field is present it overrules the detected value.
if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
! valid = (int)dict_get_bool(d, (char_u *)"valid", FALSE);

status = qf_add_entry(qfl,
NULL, // dir
*** ../vim-8.2.1617/src/testdir/test_vim9_func.vim 2020-09-05 21:57:49.492963210 +0200
--- src/testdir/test_vim9_func.vim 2020-09-05 22:31:04.502991255 +0200
***************
*** 1614,1619 ****
--- 1614,1626 ----
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')
*** ../vim-8.2.1617/src/version.c 2020-09-05 21:57:49.492963210 +0200
--- src/version.c 2020-09-05 22:37:20.278016439 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1618,
/**/

--
We learn from our mistakes. Politicians don't make mistakes.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages