Skip to content

Commit 71fb0c1

Browse files
committed
patch 7.4.1699
Problem: :packadd does not work the same when used early or late. Solution: Always load plugins matching "plugin/**/*.vim".
1 parent 298c659 commit 71fb0c1

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/ex_cmds2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3376,7 +3376,7 @@ add_pack_plugin(char_u *fname, void *cookie)
33763376

33773377
if (load_files)
33783378
{
3379-
static char *plugpat = "%s/plugin/*.vim";
3379+
static char *plugpat = "%s/plugin/**/*.vim";
33803380
static char *ftpat = "%s/ftdetect/*.vim";
33813381
int len;
33823382
char_u *pat;

src/testdir/test_packadd.vim

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func TearDown()
1111
endfunc
1212

1313
func Test_packadd()
14-
call mkdir(s:plugdir . '/plugin', 'p')
14+
call mkdir(s:plugdir . '/plugin/also', 'p')
1515
call mkdir(s:plugdir . '/ftdetect', 'p')
1616
set rtp&
1717
let rtp = &rtp
@@ -21,13 +21,18 @@ func Test_packadd()
2121
call setline(1, 'let g:plugin_works = 42')
2222
wq
2323

24+
exe 'split ' . s:plugdir . '/plugin/also/loaded.vim'
25+
call setline(1, 'let g:plugin_also_works = 77')
26+
wq
27+
2428
exe 'split ' . s:plugdir . '/ftdetect/test.vim'
2529
call setline(1, 'let g:ftdetect_works = 17')
2630
wq
2731

2832
packadd mytest
2933

3034
call assert_equal(42, g:plugin_works)
35+
call assert_equal(77, g:plugin_also_works)
3136
call assert_equal(17, g:ftdetect_works)
3237
call assert_true(len(&rtp) > len(rtp))
3338
call assert_true(&rtp =~ 'testdir/Xdir/pack/mine/opt/mytest\($\|,\)')

src/version.c

+2
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+
1699,
751753
/**/
752754
1698,
753755
/**/

0 commit comments

Comments
 (0)