Skip to content

Commit d22a189

Browse files
committed
patch 7.4.1585
Problem: Partial is not recognized everywhere. Solution: Check for partial in trans_function_name(). (Yasuhiro Matsumoto) Add a test.
1 parent 0e0b3dd commit d22a189

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/eval.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23893,6 +23893,12 @@ trans_function_name(
2389323893
name = vim_strsave(lv.ll_tv->vval.v_string);
2389423894
*pp = end;
2389523895
}
23896+
else if (lv.ll_tv->v_type == VAR_PARTIAL
23897+
&& lv.ll_tv->vval.v_partial != NULL)
23898+
{
23899+
name = vim_strsave(lv.ll_tv->vval.v_partial->pt_name);
23900+
*pp = end;
23901+
}
2389623902
else
2389723903
{
2389823904
if (!skip && !(flags & TFN_QUIET) && (fdp == NULL

src/testdir/test_partial.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,15 @@ func Test_script_function_in_dict()
106106
let B = s:obj2.clear
107107
call assert_equal('bar', B())
108108
endfunc
109+
110+
func Test_partial_exists()
111+
let F = function('MyFunc')
112+
call assert_true(exists('*F'))
113+
let lF = [F]
114+
call assert_true(exists('*lF[0]'))
115+
116+
let F = function('MyFunc', ['arg'])
117+
call assert_true(exists('*F'))
118+
let lF = [F]
119+
call assert_true(exists('*lF[0]'))
120+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1585,
751753
/**/
752754
1584,
753755
/**/

0 commit comments

Comments
 (0)