aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-09-11 16:20:59 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2021-09-18 13:53:50 +0200
commit396280d3030685c6b7c4d962f24bb5171a735b47 (patch)
tree08b04faa0d1fd328f0e89e8541b444c229633cd9 /src/nvim/main.c
parent8ef2b56cac895c151345cf0ff0a97456c0a7fdd2 (diff)
downloadrneovim-396280d3030685c6b7c4d962f24bb5171a735b47.tar.gz
rneovim-396280d3030685c6b7c4d962f24bb5171a735b47.tar.bz2
rneovim-396280d3030685c6b7c4d962f24bb5171a735b47.zip
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()|
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 1fc140e525..1507dfac00 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -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