diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-07 13:13:52 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-06-18 18:01:41 -0400 |
commit | a5bde56b371e199e36840ceb4a27e0440cbad60d (patch) | |
tree | d1f2b6775c30e53fba69a6c493706b0708529168 /src/nvim/option.c | |
parent | 70d4b31b834395fe36f4886e43b63fd4dc62ded1 (diff) | |
download | rneovim-a5bde56b371e199e36840ceb4a27e0440cbad60d.tar.gz rneovim-a5bde56b371e199e36840ceb4a27e0440cbad60d.tar.bz2 rneovim-a5bde56b371e199e36840ceb4a27e0440cbad60d.zip |
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'.
https://github.com/vim/vim/commit/072687032683b1994d25a114893d9a6f8bc36612
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 96f8e1529a..55ae0b7003 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -524,11 +524,17 @@ char *get_lib_dir(void) /// /// Windows: Uses "…/nvim-data" for kXDGDataHome to avoid storing /// configuration and data files in the same path. #4403 -static void set_runtimepath_default(void) +/// +/// If "clean_arg" is true, Nvim was started with --clean. +static void set_runtimepath_default(bool clean_arg) { size_t rtp_size = 0; - char *const data_home = stdpaths_get_xdg_var(kXDGDataHome); - char *const config_home = stdpaths_get_xdg_var(kXDGConfigHome); + char *const data_home = clean_arg + ? NULL + : stdpaths_get_xdg_var(kXDGDataHome); + char *const config_home = clean_arg + ? NULL + : stdpaths_get_xdg_var(kXDGConfigHome); char *const vimruntime = vim_getenv("VIMRUNTIME"); char *const libdir = get_lib_dir(); char *const data_dirs = stdpaths_get_xdg_var(kXDGDataDirs); @@ -622,7 +628,8 @@ static void set_runtimepath_default(void) /// Initialize the options, first part. /// /// Called only once from main(), just after creating the first buffer. -void set_init_1(void) +/// If "clean_arg" is true, Nvim was started with --clean. +void set_init_1(bool clean_arg) { int opt_idx; @@ -765,7 +772,7 @@ void set_init_1(void) true); // Set default for &runtimepath. All necessary expansions are performed in // this function. - set_runtimepath_default(); + set_runtimepath_default(clean_arg); /* * Set all the options (except the terminal options) to their default |