mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
vim-patch:7.4.1699 (#5660)
Problem: :packadd does not work the same when used early or late.
Solution: Always load plugins matching "plugin/**/*.vim".
71fb0c146b
This commit is contained in:

committed by
Justin M. Keyes

parent
3979c6cbed
commit
783c9aac8e
@@ -2552,7 +2552,7 @@ static void add_pack_plugin(char_u *fname, void *cookie)
|
||||
}
|
||||
|
||||
if (cookie != &APP_ADD_DIR) {
|
||||
static const char *plugpat = "%s/plugin/*.vim"; // NOLINT
|
||||
static const char *plugpat = "%s/plugin/**/*.vim"; // NOLINT
|
||||
static const char *ftpat = "%s/ftdetect/*.vim"; // NOLINT
|
||||
|
||||
size_t len = STRLEN(ffname) + STRLEN(ftpat);
|
||||
|
@@ -745,7 +745,7 @@ static int included_patches[] = {
|
||||
// 1702,
|
||||
// 1701,
|
||||
1700,
|
||||
// 1699,
|
||||
1699,
|
||||
// 1698 NA
|
||||
1697,
|
||||
1696,
|
||||
|
@@ -27,7 +27,7 @@ describe('packadd', function()
|
||||
endfunc
|
||||
|
||||
func Test_packadd()
|
||||
call mkdir(s:plugdir . '/plugin', 'p')
|
||||
call mkdir(s:plugdir . '/plugin/also', 'p')
|
||||
call mkdir(s:plugdir . '/ftdetect', 'p')
|
||||
call mkdir(s:plugdir . '/after', 'p')
|
||||
set rtp&
|
||||
@@ -38,6 +38,10 @@ describe('packadd', function()
|
||||
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
|
||||
@@ -45,6 +49,7 @@ describe('packadd', function()
|
||||
packadd mytest
|
||||
|
||||
call assert_true(42, g:plugin_works)
|
||||
call assert_equal(77, g:plugin_also_works)
|
||||
call assert_true(17, g:ftdetect_works)
|
||||
call assert_true(len(&rtp) > len(rtp))
|
||||
call assert_true(&rtp =~ (s:plugdir . '\($\|,\)'))
|
||||
|
Reference in New Issue
Block a user