patch 9.1.0393: 'viewdir' not respecting $XDG_CONFIG_HOME
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>
diff --git a/src/os_unix.h b/src/os_unix.h
index 6efd8ce..99184ab 100644
--- a/src/os_unix.h
+++ b/src/os_unix.h
@@ -347,6 +347,8 @@
# define DFLT_VDIR "sys$login:vimfiles/view"
# else
# define DFLT_VDIR "$HOME/.vim/view" // default for 'viewdir'
+# define XDG_VDIR (mch_getenv("XDG_CONFIG_HOME") ? \
+ "$XDG_CONFIG_HOME/vim/view" : "~/.config/vim/view")
# endif
#endif