Mercurial > vim
comparison src/main.c @ 13361:65c29bd4548b v8.0.1554
patch 8.0.1554: custom plugins loaded with --clean
commit https://github.com/vim/vim/commit/072687032683b1994d25a114893d9a6f8bc36612
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 1 21:57:32 2018 +0100
patch 8.0.1554: custom plugins loaded with --clean
Problem: Custom plugins loaded with --clean.
Solution: Do not include the home directory in 'runtimepath'.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 01 Mar 2018 22:00:09 +0100 |
parents | ac42c4b11dbc |
children | 2103b009e32d |
comparison
equal
deleted
inserted
replaced
13360:7c7ebafc5c3c | 13361:65c29bd4548b |
---|---|
156 atexit(vim_mem_profile_dump); | 156 atexit(vim_mem_profile_dump); |
157 #endif | 157 #endif |
158 | 158 |
159 #ifdef STARTUPTIME | 159 #ifdef STARTUPTIME |
160 /* Need to find "--startuptime" before actually parsing arguments. */ | 160 /* Need to find "--startuptime" before actually parsing arguments. */ |
161 for (i = 1; i < argc; ++i) | 161 for (i = 1; i < argc - 1; ++i) |
162 { | 162 if (STRICMP(argv[i], "--startuptime") == 0) |
163 if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc) | |
164 { | 163 { |
165 time_fd = mch_fopen(argv[i + 1], "a"); | 164 time_fd = mch_fopen(argv[i + 1], "a"); |
166 TIME_MSG("--- VIM STARTING ---"); | 165 TIME_MSG("--- VIM STARTING ---"); |
167 break; | 166 break; |
168 } | 167 } |
169 } | |
170 #endif | 168 #endif |
171 starttime = time(NULL); | 169 starttime = time(NULL); |
172 | 170 |
171 #ifdef CLEAN_RUNTIMEPATH | |
172 /* Need to find "--clean" before actually parsing arguments. */ | |
173 for (i = 1; i < argc; ++i) | |
174 if (STRICMP(argv[i], "--clean") == 0) | |
175 { | |
176 params.clean = TRUE; | |
177 break; | |
178 } | |
179 #endif | |
173 common_init(¶ms); | 180 common_init(¶ms); |
174 | 181 |
175 #ifdef FEAT_CLIENTSERVER | 182 #ifdef FEAT_CLIENTSERVER |
176 /* | 183 /* |
177 * Do the client-server stuff, unless "--servername ''" was used. | 184 * Do the client-server stuff, unless "--servername ''" was used. |
1022 * because this is where "has_mbyte" will be set, which is used by | 1029 * because this is where "has_mbyte" will be set, which is used by |
1023 * msg_outtrans_len_attr(). | 1030 * msg_outtrans_len_attr(). |
1024 * First find out the home directory, needed to expand "~" in options. | 1031 * First find out the home directory, needed to expand "~" in options. |
1025 */ | 1032 */ |
1026 init_homedir(); /* find real value of $HOME */ | 1033 init_homedir(); /* find real value of $HOME */ |
1027 set_init_1(); | 1034 set_init_1(paramp->clean); |
1028 TIME_MSG("inits 1"); | 1035 TIME_MSG("inits 1"); |
1029 | 1036 |
1030 #ifdef FEAT_EVAL | 1037 #ifdef FEAT_EVAL |
1031 set_lang_var(); /* set v:lang and v:ctype */ | 1038 set_lang_var(); /* set v:lang and v:ctype */ |
1032 #endif | 1039 #endif |
1901 mch_exit(0); | 1908 mch_exit(0); |
1902 } | 1909 } |
1903 else if (STRNICMP(argv[0] + argv_idx, "clean", 5) == 0) | 1910 else if (STRNICMP(argv[0] + argv_idx, "clean", 5) == 0) |
1904 { | 1911 { |
1905 parmp->use_vimrc = (char_u *)"DEFAULTS"; | 1912 parmp->use_vimrc = (char_u *)"DEFAULTS"; |
1913 parmp->clean = TRUE; | |
1906 set_option_value((char_u *)"vif", 0L, (char_u *)"NONE", 0); | 1914 set_option_value((char_u *)"vif", 0L, (char_u *)"NONE", 0); |
1907 } | 1915 } |
1908 else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) | 1916 else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) |
1909 { | 1917 { |
1910 #ifdef EXPAND_FILENAMES | 1918 #ifdef EXPAND_FILENAMES |