diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 7 | ||||
-rw-r--r-- | src/testdir/test_eval.in | 5 | ||||
-rw-r--r-- | src/testdir/test_eval.ok | 4 | ||||
-rw-r--r-- | src/testdir/test_eval_func.vim | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
5 files changed, 28 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index a4727127f6..93d33a2c96 100644 --- a/src/eval.c +++ b/src/eval.c @@ -17883,6 +17883,13 @@ trans_function_name ( if (name != NULL) { name = vim_strsave(name); *pp = end; + if (strncmp((char *)name, "<SNR>", 5) == 0) { + // Change "<SNR>" to the byte sequence. + name[0] = K_SPECIAL; + name[1] = KS_EXTRA; + name[2] = (int)KE_SNR; + memmove(name + 3, name + 5, strlen((char *)name + 5) + 1); + } goto theend; } diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in index 3ab85301cf..09932261af 100644 --- a/src/testdir/test_eval.in +++ b/src/testdir/test_eval.in @@ -36,7 +36,10 @@ STARTTEST :echo g:Foo(2) :echo Foo(3) -:$-5,$w! test.out +:" script-local function used in Funcref must exist. +:so test_eval_func.vim + +:$-9,$w! test.out :q! ENDTEST diff --git a/src/testdir/test_eval.ok b/src/testdir/test_eval.ok index c8f6dc7591..c7620836f7 100644 --- a/src/testdir/test_eval.ok +++ b/src/testdir/test_eval.ok @@ -4,3 +4,7 @@ Vim(function):E128: Function name must start with a capital or "s:": b:test() called Foo(1) called Foo(2) called Foo(3) +s:Testje exists: 0 +func s:Testje exists: 1 +Bar exists: 1 +func Bar exists: 1 diff --git a/src/testdir/test_eval_func.vim b/src/testdir/test_eval_func.vim new file mode 100644 index 0000000000..48d01df27d --- /dev/null +++ b/src/testdir/test_eval_func.vim @@ -0,0 +1,12 @@ +" Vim script used in test_eval.in. Needed for script-local function. + +func! s:Testje() + return "foo" +endfunc + +let Bar = function('s:Testje') + +$put ='s:Testje exists: ' . exists('s:Testje') +$put ='func s:Testje exists: ' . exists('*s:Testje') +$put ='Bar exists: ' . exists('Bar') +$put ='func Bar exists: ' . exists('*Bar') diff --git a/src/version.c b/src/version.c index e59e7fe8a4..6e41f41c97 100644 --- a/src/version.c +++ b/src/version.c @@ -204,7 +204,7 @@ static int included_patches[] = { // Add new patch number below this line //270, 269, - //268, + 268, //267, 266, 265, |