File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed
Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -250,9 +250,9 @@ typedef struct dsc$descriptor DESC;
250250#endif
251251
252252#ifndef XDG_VIMRC_FILE
253- # define XDG_VIMRC_FILE mch_getenv("XDG_CONFIG_HOME") \
254- ? (char_u *) "$XDG_CONFIG_HOME/vim/vimrc" \
255- : (char_u *) "~/.config/vim/vimrc"
253+ # define XDG_VIMRC_FILE ( mch_getenv("XDG_CONFIG_HOME") \
254+ ? "$XDG_CONFIG_HOME/vim/vimrc" \
255+ : "~/.config/vim/vimrc")
256256#endif
257257
258258#if !defined(USR_VIMRC_FILE3 ) && defined(VMS )
Original file line number Diff line number Diff line change @@ -137,4 +137,21 @@ func Test_xdg_runtime_files()
137137 unlet $XDG_CONFIG_HOME
138138endfunc
139139
140+ func Test_xdg_version ()
141+ CheckUnix
142+ let $HOME = getcwd () .. ' /XfakeHOME'
143+ unlet $XDG_CONFIG_HOME
144+ let a = execute (' :version' )- >split (' \n' )
145+ let a = filter (a , { _, val - > val = ~ ' \.config\|XDG_CONFIG_HOME' })
146+ call assert_equal (1 , len (a ))
147+ call assert_match (' \~/.config/vim/vimrc' , a [0 ])
148+
149+ let $XDG_CONFIG_HOME = expand (' ~/.xdg' )
150+ let a = execute (' :version' )- >split (' \n' )
151+ let a = filter (a , { _, val - > val = ~ ' \.config\|XDG_CONFIG_HOME' })
152+ call assert_equal (1 , len (a ))
153+ call assert_match (' XDG_CONFIG_HOME/vim/vimrc' , a [0 ])
154+ unlet $XDG_CONFIG_HOME
155+ endfunc
156+
140157" vim: shiftwidth = 2 sts = 2 expandtab
Original file line number Diff line number Diff line change @@ -704,6 +704,8 @@ static char *(features[]) =
704704
705705static int included_patches [] =
706706{ /* Add new patch number below this line */
707+ /**/
708+ 337 ,
707709/**/
708710 336 ,
709711/**/
@@ -1743,10 +1745,21 @@ list_version(void)
17431745 version_msg (USR_VIMRC_FILE2 );
17441746 version_msg ("\"\n" );
17451747#endif
1746- #ifdef USR_VIMRC_FILE3
1748+ #if defined( USR_VIMRC_FILE3 ) && defined( XDG_VIMRC_FILE )
17471749 version_msg (_ (" 3rd user vimrc file: \"" ));
17481750 version_msg (USR_VIMRC_FILE3 );
17491751 version_msg ("\"\n" );
1752+ version_msg (_ (" 4th user vimrc file: \"" ));
1753+ version_msg ((char * )(XDG_VIMRC_FILE ));
1754+ version_msg ("\"\n" );
1755+ #elif defined(USR_VIMRC_FILE3 )
1756+ version_msg (_ (" 3rd user vimrc file: \"" ));
1757+ version_msg (USR_VIMRC_FILE3 );
1758+ version_msg ("\"\n" );
1759+ #elif defined(XDG_VIMRC_FILE )
1760+ version_msg (_ (" 3rd user vimrc file: \"" ));
1761+ version_msg ((char * )(XDG_VIMRC_FILE ));
1762+ version_msg ("\"\n" );
17501763#endif
17511764#ifdef USR_EXRC_FILE
17521765 version_msg (_ (" user exrc file: \"" ));
You can’t perform that action at this time.
0 commit comments