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 -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202009052038.085KcFtl715040%40masaka.moolenaar.net.