patch 8.2.1616: Vim9: cannot pass "true" to synID()
Problem: Vim9: cannot pass "true" to synID(). Solution: Use tv_get_bool_chk(). (closes #6860)
This commit is contained in:
@ -8487,7 +8487,7 @@ f_synID(typval_T *argvars UNUSED, typval_T *rettv)
|
|||||||
|
|
||||||
lnum = tv_get_lnum(argvars); // -1 on type error
|
lnum = tv_get_lnum(argvars); // -1 on type error
|
||||||
col = (linenr_T)tv_get_number(&argvars[1]) - 1; // -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);
|
trans = (int)tv_get_bool_chk(&argvars[2], &transerr);
|
||||||
|
|
||||||
if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
|
if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
|
||||||
&& col >= 0 && col < (long)STRLEN(ml_get(lnum)))
|
&& col >= 0 && col < (long)STRLEN(ml_get(lnum)))
|
||||||
|
|||||||
@ -1551,6 +1551,13 @@ def Test_searchdecl()
|
|||||||
assert_equal(1, searchdecl('blah', true, true))
|
assert_equal(1, searchdecl('blah', true, true))
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_synID()
|
||||||
|
new
|
||||||
|
setline(1, "text")
|
||||||
|
assert_equal(0, synID(1, 1, true))
|
||||||
|
bwipe!
|
||||||
|
enddef
|
||||||
|
|
||||||
def Fibonacci(n: number): number
|
def Fibonacci(n: number): number
|
||||||
if n < 2
|
if n < 2
|
||||||
return n
|
return n
|
||||||
|
|||||||
@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1616,
|
||||||
/**/
|
/**/
|
||||||
1615,
|
1615,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user