Patch 8.2.3224
Problem: Cannot call script-local function after :vim9cmd. (Christian J.
Robinson)
Solution: Skip over "<SNR>123".
Files: src/vim9compile.c, src/eval.c, src/testdir/test_vim9_cmd.vim
*** ../vim-8.2.3223/src/vim9compile.c 2021-07-25 18:06:44.155292431 +0200
--- src/vim9compile.c 2021-07-26 20:59:57.594968597 +0200
***************
*** 3562,3575 ****
/*
* Like to_name_end() but also skip over a list or dict constant.
* This intentionally does not handle line continuation.
*/
char_u *
to_name_const_end(char_u *arg)
{
! char_u *p = to_name_end(arg, TRUE);
typval_T rettv;
if (p == arg && *arg == '[')
{
--- 3562,3579 ----
/*
* Like to_name_end() but also skip over a list or dict constant.
+ * Also accept "<SNR>123_Func".
* This intentionally does not handle line continuation.
*/
char_u *
to_name_const_end(char_u *arg)
{
! char_u *p = arg;
typval_T rettv;
+ if (STRNCMP(p, "<SNR>", 5) == 0)
+ p = skipdigits(p + 5);
+ p = to_name_end(p, TRUE);
if (p == arg && *arg == '[')
{
*** ../vim-8.2.3223/src/eval.c 2021-07-25 14:13:50.040566339 +0200
--- src/eval.c 2021-07-26 21:00:35.866892338 +0200
***************
*** 3326,3332 ****
: (evalarg->eval_flags & EVAL_EVALUATE);
// Recognize <type> in Vim9 script only.
! if (in_vim9script() && **arg == '<' && eval_isnamec1((*arg)[1]))
{
++*arg;
ga_init2(&type_list, sizeof(type_T *), 10);
--- 3326,3333 ----
: (evalarg->eval_flags & EVAL_EVALUATE);
// Recognize <type> in Vim9 script only.
! if (in_vim9script() && **arg == '<' && eval_isnamec1((*arg)[1])
! && STRNCMP(*arg, "<SNR>", 5) != 0)
{
++*arg;
ga_init2(&type_list, sizeof(type_T *), 10);
*** ../vim-8.2.3223/src/testdir/test_vim9_cmd.vim 2021-06-06 21:38:04.941344567 +0200
--- src/testdir/test_vim9_cmd.vim 2021-07-26 20:59:28.895025336 +0200
***************
*** 14,19 ****
--- 14,33 ----
END
CheckScriptSuccess(lines)
assert_fails('vim9cmd', 'E1164:')
+
+ lines =<< trim END
+ vim9script
+ def Foo()
+ g:found_bar = "bar"
+ enddef
+ nmap ,; :vim9cmd <SID>Foo()<CR>
+ END
+ CheckScriptSuccess(lines)
+ feedkeys(',;', 'xt')
+ assert_equal("bar", g:found_bar)
+
+ nunmap ,;
+ unlet g:found_bar
enddef
def Test_edit_wildcards()
*** ../vim-8.2.3223/src/version.c 2021-07-25 20:27:03.227912383 +0200
--- src/version.c 2021-07-26 21:07:21.702050539 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3224,
/**/
--
"Marriage is when a man and woman become as one; the trouble starts
when they try to decide which one"
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///