aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-06-26 17:56:09 +0300
committerZyX <kp-pav@yandex.ru>2016-07-10 02:04:27 +0300
commitc47624482c4ec23d055e30ecb3e24b04794f1235 (patch)
treef40e61f8cbddc144a0f19e29c7b47846ce7152ba
parent895f712df8afc053b59783189954e665ccd21dab (diff)
downloadrneovim-c47624482c4ec23d055e30ecb3e24b04794f1235.tar.gz
rneovim-c47624482c4ec23d055e30ecb3e24b04794f1235.tar.bz2
rneovim-c47624482c4ec23d055e30ecb3e24b04794f1235.zip
option: Also do not expand XDG defaults with set&
-rw-r--r--src/nvim/option.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index e75cb38c9e..481e7daa0f 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1477,15 +1477,18 @@ do_set (
* default value was already expanded, only
* required when an environment variable was set
* later */
- if (newval == NULL)
+ new_value_alloced = true;
+ if (newval == NULL) {
newval = empty_option;
- else {
+ } else if (!(options[opt_idx].flags | P_NO_DEF_EXP)) {
s = option_expand(opt_idx, newval);
- if (s == NULL)
+ if (s == NULL) {
s = newval;
+ }
newval = vim_strsave(s);
+ } else {
+ newval = (char_u *)xstrdup((char *)newval);
}
- new_value_alloced = TRUE;
} else if (nextchar == '<') { /* set to global val */
newval = vim_strsave(*(char_u **)get_varp_scope(
&(options[opt_idx]), OPT_GLOBAL));