Patch 8.2.1606

6 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 5, 2020, 12:46:05 PM9/5/20
to vim...@googlegroups.com

Patch 8.2.1606
Problem: Vim9: cannot use "true" with has().
Solution: Use tv_get_bool(). (closes #6876)
Files: src/evalfunc.c, src/testdir/test_vim9_func.vim


*** ../vim-8.2.1605/src/evalfunc.c 2020-09-05 17:30:40.998542895 +0200
--- src/evalfunc.c 2020-09-05 18:44:06.515757252 +0200
***************
*** 4763,4769 ****
}
}

! if (argvars[1].v_type != VAR_UNKNOWN && tv_get_number(&argvars[1]) != 0)
// return whether feature could ever be enabled
rettv->vval.v_number = x;
else
--- 4763,4769 ----
}
}

! if (argvars[1].v_type != VAR_UNKNOWN && tv_get_bool(&argvars[1]))
// return whether feature could ever be enabled
rettv->vval.v_number = x;
else
*** ../vim-8.2.1605/src/testdir/test_vim9_func.vim 2020-09-05 18:31:30.012880922 +0200
--- src/testdir/test_vim9_func.vim 2020-09-05 18:43:41.979804049 +0200
***************
*** 1516,1521 ****
--- 1516,1525 ----
set wildignore&
enddef

+ def Test_has()
+ assert_equal(1, has('eval', true))
+ enddef
+
def Fibonacci(n: number): number
if n < 2
return n
*** ../vim-8.2.1605/src/version.c 2020-09-05 18:40:38.440139606 +0200
--- src/version.c 2020-09-05 18:45:07.683638863 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1606,
/**/

--
No letters of the alphabet were harmed in the creation of this message.

/// 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