mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:8.0.0612
Problem: Package directories are added to 'runtimepath' only after loading
non-package plugins.
Solution: Split off the code to add package directories to 'runtimepath'.
(Ingo Karkat, closes vim/vim#1680)
ce876aaa9a
This commit is contained in:
@@ -2623,23 +2623,31 @@ theend:
|
||||
xfree(ffname);
|
||||
}
|
||||
|
||||
static bool did_source_packages = false;
|
||||
/// Add all packages in the "start" directory to 'runtimepath'.
|
||||
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);
|
||||
}
|
||||
|
||||
/// Load plugins from all packages in the "start" directory.
|
||||
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);
|
||||
}
|
||||
|
||||
// ":packloadall"
|
||||
// Find plugins in the package directories and source them.
|
||||
// "eap" is NULL when invoked during startup.
|
||||
void ex_packloadall(exarg_T *eap)
|
||||
{
|
||||
if (!did_source_packages || (eap != NULL && eap->forceit)) {
|
||||
did_source_packages = true;
|
||||
|
||||
if (!did_source_packages || eap->forceit) {
|
||||
// First do a round to add all directories to 'runtimepath', then load
|
||||
// the plugins. This allows for plugins to use an autoload directory
|
||||
// of another plugin.
|
||||
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 *)"pack/*/start/*", DIP_ALL + DIP_DIR, // NOLINT
|
||||
add_pack_plugin, &APP_LOAD);
|
||||
add_pack_start_dirs();
|
||||
load_start_packages();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user