Mercurial > vim
changeset 8591:5bc958a92849 v7.4.1585
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 17 20:50:47 2016 +0100
patch 7.4.1585
Problem: Partial is not recognized everywhere.
Solution: Check for partial in trans_function_name(). (Yasuhiro Matsumoto)
Add a test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Mar 2016 21:00:04 +0100 |
parents | d28bd403e1f1 |
children | 628fe55c56ba |
files | src/eval.c src/testdir/test_partial.vim src/version.c |
diffstat | 3 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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