[vim] 11/139: patch 7.4.1699 Problem: :packadd does not work the same when used early or late. Solution: Always load plugins matching "plugin/**/*.vim".

James McCoy jamessan at debian.org
Fri May 6 03:59:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository vim.

commit 71fb0c146bef08dc276fc5793bd47366e6e0f32a
Author: Bram Moolenaar <Bram at vim.org>
Date:   Sat Apr 2 22:44:16 2016 +0200

    patch 7.4.1699
    Problem:    :packadd does not work the same when used early or late.
    Solution:   Always load plugins matching "plugin/**/*.vim".
---
 src/ex_cmds2.c               | 2 +-
 src/testdir/test_packadd.vim | 7 ++++++-
 src/version.c                | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index c03c240..9f74376 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -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;
diff --git a/src/testdir/test_packadd.vim b/src/testdir/test_packadd.vim
index 44b733f..9e75c33 100644
--- a/src/testdir/test_packadd.vim
+++ b/src/testdir/test_packadd.vim
@@ -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\($\|,\)')
diff --git a/src/version.c b/src/version.c
index 19e44d8..23d4acb 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 */
 /**/
+    1699,
+/**/
     1698,
 /**/
     1697,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/vim.git



More information about the pkg-vim-maintainers mailing list