diff options
author | James McCoy <jamessan@jamessan.com> | 2017-08-21 12:54:22 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-08-21 20:29:49 -0400 |
commit | 41d180abb4693814be5833b0907e111ce46b3791 (patch) | |
tree | 56432497a1df2af1756e845fa48a44fb86427727 /src/nvim/main.c | |
parent | 622c3454dff35cae7ec93383bbf49f16621dc778 (diff) | |
download | rneovim-41d180abb4693814be5833b0907e111ce46b3791.tar.gz rneovim-41d180abb4693814be5833b0907e111ce46b3791.tar.bz2 rneovim-41d180abb4693814be5833b0907e111ce46b3791.zip |
vim-patch:8.0.0680
Problem: Plugins in start packages are sourced twice. (mseplowitz)
Solution: Use the unmodified runtime path when loading plugins (test by Ingo
Karkat, closes vim/vim#1801)
https://github.com/vim/vim/commit/07ecfa64a18609a986f21d6132d04ee8934f3200
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 6e85fbc130..f601fd7ea3 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1291,15 +1291,23 @@ static void set_window_layout(mparm_T *paramp) static void load_plugins(void) { if (p_lpl) { + char_u *rtp_copy = NULL; + // 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_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_NOAFTER); // NOLINT + source_in_path(rtp_copy == NULL ? p_rtp : rtp_copy, + (char_u *)"plugin/**/*.vim", // NOLINT + DIP_ALL | DIP_NOAFTER); TIME_MSG("loading plugins"); + xfree(rtp_copy); // Only source "start" packages if not done already with a :packloadall // command. |