0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.1554: custom plugins loaded with --clean

Problem:    Custom plugins loaded with --clean.
Solution:   Do not include the home directory in 'runtimepath'.
This commit is contained in:
Bram Moolenaar
2018-03-01 21:57:32 +01:00
parent 5f73ef8d20
commit 0726870326
10 changed files with 48 additions and 7 deletions

View File

@@ -158,18 +158,25 @@ main
#ifdef STARTUPTIME
/* Need to find "--startuptime" before actually parsing arguments. */
for (i = 1; i < argc; ++i)
{
if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc)
for (i = 1; i < argc - 1; ++i)
if (STRICMP(argv[i], "--startuptime") == 0)
{
time_fd = mch_fopen(argv[i + 1], "a");
TIME_MSG("--- VIM STARTING ---");
break;
}
}
#endif
starttime = time(NULL);
#ifdef CLEAN_RUNTIMEPATH
/* Need to find "--clean" before actually parsing arguments. */
for (i = 1; i < argc; ++i)
if (STRICMP(argv[i], "--clean") == 0)
{
params.clean = TRUE;
break;
}
#endif
common_init(&params);
#ifdef FEAT_CLIENTSERVER
@@ -1024,7 +1031,7 @@ common_init(mparm_T *paramp)
* First find out the home directory, needed to expand "~" in options.
*/
init_homedir(); /* find real value of $HOME */
set_init_1();
set_init_1(paramp->clean);
TIME_MSG("inits 1");
#ifdef FEAT_EVAL
@@ -1903,6 +1910,7 @@ command_line_scan(mparm_T *parmp)
else if (STRNICMP(argv[0] + argv_idx, "clean", 5) == 0)
{
parmp->use_vimrc = (char_u *)"DEFAULTS";
parmp->clean = TRUE;
set_option_value((char_u *)"vif", 0L, (char_u *)"NONE", 0);
}
else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0)