mirror of
https://github.com/neovim/neovim.git
synced 2025-09-21 18:58:18 +00:00
refactor(runtime): always use DIP_START when searching for runtime files
Now remove the addition of "start/*" packages in 'packpath' as explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming very long when using a lot of plugins as packages. To get the effective search path as a list, use |nvim_list_runtime_paths()|
This commit is contained in:
@@ -1352,23 +1352,10 @@ static void load_plugins(void)
|
||||
char_u *const plugin_pattern_vim = (char_u *)"plugin/**/*.vim"; // NOLINT
|
||||
char_u *const plugin_pattern_lua = (char_u *)"plugin/**/*.lua"; // NOLINT
|
||||
|
||||
// First add all package directories to 'runtimepath', so that their
|
||||
// autoload directories can be found. Only if not done already with a
|
||||
// :packloadall command.
|
||||
// Make a copy of 'runtimepath', so that source_runtime does not use the
|
||||
// pack directories.
|
||||
if (!did_source_packages) {
|
||||
rtp_copy = vim_strsave(p_rtp);
|
||||
add_pack_start_dirs();
|
||||
}
|
||||
|
||||
source_in_path(rtp_copy == NULL ? p_rtp : rtp_copy,
|
||||
plugin_pattern_vim,
|
||||
DIP_ALL | DIP_NOAFTER);
|
||||
source_in_path(rtp_copy == NULL ? p_rtp : rtp_copy,
|
||||
plugin_pattern_lua,
|
||||
DIP_ALL | DIP_NOAFTER);
|
||||
TIME_MSG("loading plugins");
|
||||
// don't use source_runtime() yet so we can check for :packloadall below
|
||||
source_in_path(p_rtp, plugin_pattern_vim, DIP_ALL | DIP_NOAFTER);
|
||||
source_in_path(p_rtp, plugin_pattern_lua, DIP_ALL | DIP_NOAFTER);
|
||||
TIME_MSG("loading rtp plugins");
|
||||
xfree(rtp_copy);
|
||||
|
||||
// Only source "start" packages if not done already with a :packloadall
|
||||
|
Reference in New Issue
Block a user