summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-26 21:10:11 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-26 21:10:11 +0200
commit678b207fb111840fec1f0dc43910613ba106b90d (patch)
treec897c4e8f66da66dac4c1dec63b677038b48b19e /src/vim9compile.c
parentff34bee3a2d22f2ff7abd4519270b5518082c33d (diff)
downloadvim-git-678b207fb111840fec1f0dc43910613ba106b90d.tar.gz
patch 8.2.3224: cannot call script-local function after :vim9cmdv8.2.3224
Problem: Cannot call script-local function after :vim9cmd. (Christian J. Robinson) Solution: Skip over "<SNR>123".
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 62d73733b..7d169f8c2 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3562,14 +3562,18 @@ to_name_end(char_u *arg, int use_namespace)
/*
* 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 == '[')
{