]> granicus.if.org Git - vim/commitdiff
patch 7.4.1585 v7.4.1585
authorBram Moolenaar <Bram@vim.org>
Thu, 17 Mar 2016 19:50:47 +0000 (20:50 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 17 Mar 2016 19:50:47 +0000 (20:50 +0100)
Problem:    Partial is not recognized everywhere.
Solution:   Check for partial in trans_function_name(). (Yasuhiro Matsumoto)
            Add a test.

src/eval.c
src/testdir/test_partial.vim
src/version.c

index 6280323aa5027fd19001d846331071511c2e2766..9491f4f6a2f182644e54d8eb7fa9c8e5baac9318 100644 (file)
@@ -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
index fe451cd8bed49dabf3927a5363b73668b0cfa046..21ad7376f68a7d7c54e5c5b97d5f4926182473d1 100644 (file)
@@ -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
index ae550bcb5d58bcd7d0a06eebf9d575997db324f3..7277cc09ab203b32e4b9e06a83cae97bfa52a2c9 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1585,
 /**/
     1584,
 /**/