summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-05-04 09:48:15 +0200
committerChristian Brabandt <cb@256bit.org>2024-05-04 09:48:15 +0200
commitc3e6e393cbd0ee171001d75fc2310070da81b657 (patch)
tree50c79fd805eff88063ae213a340f98ae41f6af65 /src/option.c
parent7edde3f39e755a573ae863de9b88f90d13c2f88b (diff)
patch 9.1.0393: 'viewdir' not respecting $XDG_CONFIG_HOMEv9.1.0393
Problem: 'viewdir' not respecting $XDG_CONFIG_HOME (Danilo Rezende, after v9.1.327) Solution: adjust 'viewdir' option when enabling XDG config mode fixes: #14680 closes: #14708 Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index 0cd2823851..2acc0d475f 100644
--- a/src/option.c
+++ b/src/option.c
@@ -417,6 +417,14 @@ set_init_xdg_rtp(void)
options[opt_idx].def_val[VI_DEFAULT] = xdg_rtp;
p_pp = xdg_rtp;
+#if defined(XDG_VDIR) && defined(FEAT_SESSION)
+ if ((opt_idx = findoption((char_u *)"viewdir")) < 0)
+ goto theend;
+
+ options[opt_idx].def_val[VI_DEFAULT] = (char_u *)XDG_VDIR;
+ p_vdir = (char_u *)XDG_VDIR;
+#endif
+
theend:
vim_free(vimrc1);
vim_free(vimrc2);