Patch 8.2.1616
Problem: Vim9: cannot pass "true" to synID().
Solution: Use tv_get_bool_chk(). (closes #6860)
Files: src/evalfunc.c, src/testdir/test_vim9_func.vim
*** ../vim-8.2.1615/src/evalfunc.c 2020-09-05 21:35:12.416000610 +0200
--- src/evalfunc.c 2020-09-05 21:40:55.351290594 +0200
***************
*** 8487,8493 ****
lnum = tv_get_lnum(argvars); // -1 on type error
col = (linenr_T)tv_get_number(&argvars[1]) - 1; // -1 on type error
! trans = (int)tv_get_number_chk(&argvars[2], &transerr);
if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
&& col >= 0 && col < (long)STRLEN(ml_get(lnum)))
--- 8487,8493 ----
lnum = tv_get_lnum(argvars); // -1 on type error
col = (linenr_T)tv_get_number(&argvars[1]) - 1; // -1 on type error
! trans = (int)tv_get_bool_chk(&argvars[2], &transerr);
if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
&& col >= 0 && col < (long)STRLEN(ml_get(lnum)))
*** ../vim-8.2.1615/src/testdir/test_vim9_func.vim 2020-09-05 21:35:12.416000610 +0200
--- src/testdir/test_vim9_func.vim 2020-09-05 21:40:16.019373563 +0200
***************
*** 1551,1556 ****
--- 1551,1563 ----
assert_equal(1, searchdecl('blah', true, true))
enddef
+ def Test_synID()
+ new
+ setline(1, "text")
+ assert_equal(0, synID(1, 1, true))
+ bwipe!
+ enddef
+
def Fibonacci(n: number): number
if n < 2
return n
*** ../vim-8.2.1615/src/version.c 2020-09-05 21:35:12.420000600 +0200
--- src/version.c 2020-09-05 21:41:29.379218551 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1616,
/**/
--
FATHER: We are here today to witness the union of two young people in the
joyful bond of the holy wedlock. Unfortunately, one of them, my son
Herbert, has just fallen to his death.
[Murmurs from CROWD; the BRIDE smiles with relief, coughs.]
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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 ///