]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.268 v7.4.268
authorBram Moolenaar <Bram@vim.org>
Tue, 29 Apr 2014 12:03:02 +0000 (14:03 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 29 Apr 2014 12:03:02 +0000 (14:03 +0200)
Problem:    Using exists() on a funcref for a script-local function does not
            work.
Solution:   Translate <SNR> to the special byte sequence.  Add a test.

Filelist
src/eval.c
src/testdir/test_eval.in
src/testdir/test_eval.ok
src/testdir/test_eval_func.vim [new file with mode: 0644]
src/version.c

index 9f73a3d894d128b0d11e43460227fed21c023a1d..60221160a022bb69fb90d8887c23b67a38215a11 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -88,6 +88,7 @@ SRC_ALL =     \
                src/testdir/test60.vim \
                src/testdir/test83-tags? \
                src/testdir/test77a.com \
+               src/testdir/test_*.vim \
                src/testdir/python2/*.py \
                src/testdir/python3/*.py \
                src/testdir/pythonx/*.py \
index f91578928334acdc61cc2be30e73d68a0a79ab60..3e1088a1e23c97847e7c01df191e3766ace06ac2 100644 (file)
@@ -22275,6 +22275,14 @@ trans_function_name(pp, skip, flags, fdp)
     {
        name = vim_strsave(name);
        *pp = end;
+       if (STRNCMP(name, "<SNR>", 5) == 0)
+       {
+           /* Change "<SNR>" to the byte sequence. */
+           name[0] = K_SPECIAL;
+           name[1] = KS_EXTRA;
+           name[2] = (int)KE_SNR;
+           mch_memmove(name + 3, name + 5, STRLEN(name + 5) + 1);
+       }
        goto theend;
     }
 
index 214a99edb975ce66af9706abd5f6c9200bbcf0dc..8c3d839a44fb67576c130ae3b4809cc282bec9b4 100644 (file)
@@ -180,6 +180,9 @@ endfun
 :echo g:Foo(2)
 :echo Foo(3)
 :"
+:" script-local function used in Funcref must exist.
+:so test_eval_func.vim
+:"
 :/^start:/+1,$wq! test.out
 :" vim: et ts=4 isk-=\: fmr=???,???
 :call getchar()
index cfe045b53e0418bf4ac285fa24f4f42a82e86982..f81927bae793f17312ce2f6dad8cf7fba80c8454 100644 (file)
Binary files a/src/testdir/test_eval.ok and b/src/testdir/test_eval.ok differ
diff --git a/src/testdir/test_eval_func.vim b/src/testdir/test_eval_func.vim
new file mode 100644 (file)
index 0000000..4fcd042
--- /dev/null
@@ -0,0 +1,10 @@
+" 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')
index 5aae1d2a7056dda3d9fb611945eaf6a23c63c009..bd97da3a4d8abeeaee7d54c561806d35458ae9bb 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    268,
 /**/
     267,
 /**/