diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2014-04-26 10:24:06 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-28 08:00:28 -0300 |
commit | 9b9c1dee1352165fea2f9108456484b30b796fd6 (patch) | |
tree | 0ba21d04483152bd212f656c5d5137e0a2f99aa8 /src/testdir/test_eval.in | |
parent | 4d0dd14189c0f0dd4ad561d65d97aa3e1589102b (diff) | |
download | rneovim-9b9c1dee1352165fea2f9108456484b30b796fd6.tar.gz rneovim-9b9c1dee1352165fea2f9108456484b30b796fd6.tar.bz2 rneovim-9b9c1dee1352165fea2f9108456484b30b796fd6.zip |
vim-patch:7.4.264
Problem: Can't define a function starting with "g:". Can't assign a
funcref to a buffer-local variable.
Solution: Skip "g:" at the start of a function name.
Don't check for colons when assigning to a variable.
https://code.google.com/p/vim/source/detail?r=00acac0af680c2d8c82db5258474b121a5908926
Diffstat (limited to 'src/testdir/test_eval.in')
-rw-r--r-- | src/testdir/test_eval.in | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in index 44eeabfe73..a142036522 100644 --- a/src/testdir/test_eval.in +++ b/src/testdir/test_eval.in @@ -1,5 +1,5 @@ STARTTEST -:" function name includes a colon +:" function name not starting with a capital :try : func! g:test() : echo "test" @@ -15,9 +15,28 @@ STARTTEST :catch : let @b = v:exception :endtry +:" function name includes a colon +:try +: func! b:test() +: echo "test" +: endfunc +:catch +: let @c = v:exception +:endtry +:" function name starting with/without "g:", buffer-local funcref. +:function! g:Foo() +: let @d = 'called Foo()' +:endfunction +:let b:my_func = function('Foo') +:let @d = 'xxx' +:call b:my_func() +:endfunction +:" clean up :%d :pu a :pu b +:pu c +:pu d :1d :wq! test.out ENDTEST |