diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-21 17:07:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 17:07:00 +0100 |
commit | 6baa669c10518b8751904a31899feb897fb7c995 (patch) | |
tree | 3c19fb1641ee978397416dd85e95e26e9703a83d /src/nvim/main.c | |
parent | 5657bb9ea6dfdf799f4d46d8e9022bd7382765e7 (diff) | |
download | rneovim-6baa669c10518b8751904a31899feb897fb7c995.tar.gz rneovim-6baa669c10518b8751904a31899feb897fb7c995.tar.bz2 rneovim-6baa669c10518b8751904a31899feb897fb7c995.zip |
vim-patch:7.4.2164 (#6326)
Problem: It is not possible to use plugins in an "after" directory to tune
the behavior of a package.
Solution: First load plugins from non-after directories, then packages and
finally plugins in after directories.
Reset 'loadplugins' before executing --cmd arguments.
https://github.com/vim/vim/commit/66459b7c98c67f8a9d39de8f08e8e8f1fca0e359
vim-patch:7.4.2172
vim-patch:7.4.2169
vim-patch:7.4.2177
vim-patch:7.4.2178
vim-patch:7.4.2184
vim-patch:8.0.0050
vim-patch:8.0.0105
vim-patch:8.0.0400
vim-patch:8.0.0405
Closes #6034
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 4416bd067c..7b1c912f4b 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -326,6 +326,12 @@ int main(int argc, char **argv) do_cmdline_cmd("augroup END"); #undef PROTO + // Reset 'loadplugins' for "-u NONE" before "--cmd" arguments. + // Allows for setting 'loadplugins' there. + if (params.use_vimrc != NULL && strcmp(params.use_vimrc, "NONE") == 0) { + p_lpl = false; + } + /* Execute --cmd arguments. */ exe_pre_commands(¶ms); @@ -1268,11 +1274,14 @@ static void set_window_layout(mparm_T *paramp) static void load_plugins(void) { if (p_lpl) { - source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL); // NOLINT + source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_NOAFTER); // NOLINT TIME_MSG("loading plugins"); ex_packloadall(NULL); TIME_MSG("loading packages"); + + source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_AFTER); + TIME_MSG("loading after plugins"); } } @@ -1708,8 +1717,6 @@ static void source_startup_scripts(const mparm_T *const parmp) if (parmp->use_vimrc != NULL) { if (strcmp(parmp->use_vimrc, "NONE") == 0 || strcmp(parmp->use_vimrc, "NORC") == 0) { - if (parmp->use_vimrc[2] == 'N') - p_lpl = false; // don't load plugins either } else { if (do_source((char_u *)parmp->use_vimrc, FALSE, DOSO_NONE) != OK) EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc); |