Problem: Cannot call script-local function after :vim9cmd. (Christian J.
Robinson)
Solution: Skip over "<SNR>123".
: (evalarg->eval_flags & EVAL_EVALUATE);
// Recognize <type> in Vim9 script only.
- if (in_vim9script() && **arg == '<' && eval_isnamec1((*arg)[1]))
+ if (in_vim9script() && **arg == '<' && eval_isnamec1((*arg)[1])
+ && STRNCMP(*arg, "<SNR>", 5) != 0)
{
++*arg;
ga_init2(&type_list, sizeof(type_T *), 10);
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()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3224,
/**/
3223,
/**/
/*
* 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 = to_name_end(arg, TRUE);
+ 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 == '[')
{