From d4f8a86700a1e5c7b3694a34392f311d78e023a6 Mon Sep 17 00:00:00 2001 From: Klemen Košir Date: Mon, 28 Apr 2014 14:31:36 +0200 Subject: vim-patch:7.4.265 Problem: Can't call a global function with "g:" in an expression. Solution: Skip the "g:" when looking up the function. https://code.google.com/p/vim/source/detail?r=8ec9d2196bee0c5108f2d2c196a660a7f4e5f29f --- src/testdir/test_eval.in | 12 +++++++----- src/testdir/test_eval.ok | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/testdir') diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in index a142036522..3722e3fe00 100644 --- a/src/testdir/test_eval.in +++ b/src/testdir/test_eval.in @@ -24,18 +24,20 @@ STARTTEST : let @c = v:exception :endtry :" function name starting with/without "g:", buffer-local funcref. -:function! g:Foo() -: let @d = 'called Foo()' +:function! g:Foo(n) +: let @d = 'called Foo(' . a:n . ')' :endfunction :let b:my_func = function('Foo') -:let @d = 'xxx' -:call b:my_func() -:endfunction :" clean up :%d :pu a :pu b :pu c +:call b:my_func(1) +:pu d +:echo g:Foo(2) +:pu d +:echo Foo(3) :pu d :1d :wq! test.out diff --git a/src/testdir/test_eval.ok b/src/testdir/test_eval.ok index 601a4261c8..c8f6dc7591 100644 --- a/src/testdir/test_eval.ok +++ b/src/testdir/test_eval.ok @@ -1,4 +1,6 @@ Vim(function):E128: Function name must start with a capital or "s:": g:test() Vim(function):E128: Function name must start with a capital or "s:": test2() "# Vim(function):E128: Function name must start with a capital or "s:": b:test() -called Foo() +called Foo(1) +called Foo(2) +called Foo(3) -- cgit