summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-06 19:01:55 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-06 19:01:55 +0200
commit66459b7c98c67f8a9d39de8f08e8e8f1fca0e359 (patch)
tree5e61d00ee66ba009f17ad1d490ce810ae89e6c2b /src/main.c
parentd76a0c15f8bdbc901015879177fd5076d34c7a06 (diff)
downloadvim-git-66459b7c98c67f8a9d39de8f08e8e8f1fca0e359.tar.gz
patch 7.4.2164v7.4.2164
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.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 51e4483e3..48e90c27f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -439,6 +439,11 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
#endif
#ifndef NO_VIM_MAIN
+ /* 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(&params);
@@ -453,14 +458,22 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
if (p_lpl)
{
# ifdef VMS /* Somehow VMS doesn't handle the "**". */
- source_runtime((char_u *)"plugin/*.vim", DIP_ALL);
+ source_runtime((char_u *)"plugin/*.vim", DIP_ALL | DIP_NOAFTER);
# else
- source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL);
+ source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_NOAFTER);
# endif
TIME_MSG("loading plugins");
ex_packloadall(NULL);
TIME_MSG("loading packages");
+
+# ifdef VMS /* Somehow VMS doesn't handle the "**". */
+ source_runtime((char_u *)"plugin/*.vim", DIP_ALL | DIP_AFTER);
+# else
+ source_runtime((char_u *)"plugin/**/*.vim", DIP_ALL | DIP_AFTER);
+# endif
+ TIME_MSG("loading after plugins");
+
}
#endif
@@ -2945,8 +2958,6 @@ source_startup_scripts(mparm_T *parmp)
if (use_gvimrc == NULL) /* don't load gvimrc either */
use_gvimrc = parmp->use_vimrc;
#endif
- if (parmp->use_vimrc[2] == 'N')
- p_lpl = FALSE; /* don't load plugins either */
}
else
{