]> granicus.if.org Git - vim/commitdiff
patch 7.4.1699 v7.4.1699
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Apr 2016 20:44:16 +0000 (22:44 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Apr 2016 20:44:16 +0000 (22:44 +0200)
Problem:    :packadd does not work the same when used early or late.
Solution:   Always load plugins matching "plugin/**/*.vim".

src/ex_cmds2.c
src/testdir/test_packadd.vim
src/version.c

index c03c2405622b509adbc288e208b321b51125e20d..9f74376f10cb20f16086bdf259152eaa53c48b25 100644 (file)
@@ -3376,7 +3376,7 @@ add_pack_plugin(char_u *fname, void *cookie)
 
     if (load_files)
     {
-       static char *plugpat = "%s/plugin/*.vim";
+       static char *plugpat = "%s/plugin/**/*.vim";
        static char *ftpat = "%s/ftdetect/*.vim";
        int         len;
        char_u      *pat;
index 44b733ffced001c0fc74186cde7c2fded490c56d..9e75c3383e24fce2183a5ef249c9dabb0691734f 100644 (file)
@@ -11,7 +11,7 @@ func TearDown()
 endfunc
 
 func Test_packadd()
-  call mkdir(s:plugdir . '/plugin', 'p')
+  call mkdir(s:plugdir . '/plugin/also', 'p')
   call mkdir(s:plugdir . '/ftdetect', 'p')
   set rtp&
   let rtp = &rtp
@@ -21,6 +21,10 @@ func Test_packadd()
   call setline(1, 'let g:plugin_works = 42')
   wq
 
+  exe 'split ' . s:plugdir . '/plugin/also/loaded.vim'
+  call setline(1, 'let g:plugin_also_works = 77')
+  wq
+
   exe 'split ' . s:plugdir . '/ftdetect/test.vim'
   call setline(1, 'let g:ftdetect_works = 17')
   wq
@@ -28,6 +32,7 @@ func Test_packadd()
   packadd mytest
 
   call assert_equal(42, g:plugin_works)
+  call assert_equal(77, g:plugin_also_works)
   call assert_equal(17, g:ftdetect_works)
   call assert_true(len(&rtp) > len(rtp))
   call assert_true(&rtp =~ 'testdir/Xdir/pack/mine/opt/mytest\($\|,\)')
index 19e44d87cec9c25854a0a7089b6a56a1f4dac50c..23d4acb833ec9a8f8ce653793892aba8a957b938 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1699,
 /**/
     1698,
 /**/