diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-11-19 15:36:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 15:36:44 +0100 |
commit | ad56527247353df4a83fc7232d8680083ec4f24f (patch) | |
tree | dfbaad7525ebd9cb6e8ca9317efa2ce09d4e9a2a /src/nvim/ex_cmds2.c | |
parent | 569e5c86bfd7e7729229030fc2045c624e5f33c4 (diff) | |
parent | a119fe15da28b166ffef6bf34067e5a7f75bbca9 (diff) | |
download | rneovim-ad56527247353df4a83fc7232d8680083ec4f24f.tar.gz rneovim-ad56527247353df4a83fc7232d8680083ec4f24f.tar.bz2 rneovim-ad56527247353df4a83fc7232d8680083ec4f24f.zip |
Merge pull request #13319 from bfredl/bfredlpackages
startup: load files from the "start" directory of each entry in 'packpath' (as documented)
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 713d18b44d..42454b7c9a 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2551,6 +2551,17 @@ int do_in_path_and_pp(char_u *path, char_u *name, int flags, done = do_in_path(p_pp, s, flags, callback, cookie); xfree(s); + + if (done == FAIL|| (flags & DIP_ALL)) { + start_dir = "start/*/%s"; // NOLINT + len = STRLEN(start_dir) + STRLEN(name); + s = xmallocz(len); + + vim_snprintf((char *)s, len, start_dir, name); + done = do_in_path(p_pp, s, flags, callback, cookie); + + xfree(s); + } } if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_OPT)) { @@ -2562,6 +2573,17 @@ int do_in_path_and_pp(char_u *path, char_u *name, int flags, done = do_in_path(p_pp, s, flags, callback, cookie); xfree(s); + + if (done == FAIL || (flags & DIP_ALL)) { + opt_dir = "opt/*/%s"; // NOLINT + len = STRLEN(opt_dir) + STRLEN(name); + s = xmallocz(len); + + vim_snprintf((char *)s, len, opt_dir, name); + done = do_in_path(p_pp, s, flags, callback, cookie); + + xfree(s); + } } return done; @@ -2822,6 +2844,8 @@ void add_pack_start_dirs(void) { do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR, // NOLINT add_pack_plugin, &APP_ADD_DIR); + do_in_path(p_pp, (char_u *)"start/*", DIP_ALL + DIP_DIR, // NOLINT + add_pack_plugin, &APP_ADD_DIR); } /// Load plugins from all packages in the "start" directory. @@ -2830,6 +2854,8 @@ void load_start_packages(void) did_source_packages = true; do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR, // NOLINT add_pack_plugin, &APP_LOAD); + do_in_path(p_pp, (char_u *)"start/*", DIP_ALL + DIP_DIR, // NOLINT + add_pack_plugin, &APP_LOAD); } // ":packloadall" |