diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-17 20:50:47 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-17 20:50:47 +0100 |
commit | d22a18928ebcb465393da1418bb88204b97badb1 (patch) | |
tree | 5e41881819a4ded59a890fed0589748ec7d0430d | |
parent | 0e0b3dd335b863603b9a2d415ef18d983e2467ae (diff) | |
download | vim-git-d22a18928ebcb465393da1418bb88204b97badb1.tar.gz |
patch 7.4.1585v7.4.1585
Problem: Partial is not recognized everywhere.
Solution: Check for partial in trans_function_name(). (Yasuhiro Matsumoto)
Add a test.
-rw-r--r-- | src/eval.c | 6 | ||||
-rw-r--r-- | src/testdir/test_partial.vim | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 6280323aa..9491f4f6a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -23893,6 +23893,12 @@ trans_function_name( name = vim_strsave(lv.ll_tv->vval.v_string); *pp = end; } + else if (lv.ll_tv->v_type == VAR_PARTIAL + && lv.ll_tv->vval.v_partial != NULL) + { + name = vim_strsave(lv.ll_tv->vval.v_partial->pt_name); + *pp = end; + } else { if (!skip && !(flags & TFN_QUIET) && (fdp == NULL diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim index fe451cd8b..21ad7376f 100644 --- a/src/testdir/test_partial.vim +++ b/src/testdir/test_partial.vim @@ -106,3 +106,15 @@ func Test_script_function_in_dict() let B = s:obj2.clear call assert_equal('bar', B()) endfunc + +func Test_partial_exists() + let F = function('MyFunc') + call assert_true(exists('*F')) + let lF = [F] + call assert_true(exists('*lF[0]')) + + let F = function('MyFunc', ['arg']) + call assert_true(exists('*F')) + let lF = [F] + call assert_true(exists('*lF[0]')) +endfunc diff --git a/src/version.c b/src/version.c index ae550bcb5..7277cc09a 100644 --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1585, +/**/ 1584, /**/ 1583, |