1
0
forked from aniani/vim

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

@@ -3345,9 +3345,10 @@ static int briopt_check(win_T *wp);
* Initialize the options, first part.
*
* Called only once from main(), just after creating the first buffer.
* If "clean_arg" is TRUE Vim was started with --clean.
*/
void
set_init_1(void)
set_init_1(int clean_arg)
{
char_u *p;
int opt_idx;
@@ -3554,6 +3555,24 @@ set_init_1(void)
*/
set_options_default(0);
#ifdef CLEAN_RUNTIMEPATH
if (clean_arg)
{
opt_idx = findoption((char_u *)"runtimepath");
if (opt_idx >= 0)
{
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)CLEAN_RUNTIMEPATH;
p_rtp = (char_u *)CLEAN_RUNTIMEPATH;
}
opt_idx = findoption((char_u *)"packpath");
if (opt_idx >= 0)
{
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)CLEAN_RUNTIMEPATH;
p_pp = (char_u *)CLEAN_RUNTIMEPATH;
}
}
#endif
#ifdef FEAT_GUI
if (found_reverse_arg)
set_option_value((char_u *)"bg", 0L, (char_u *)"dark", 0);