1
0
forked from aniani/vim

patch 9.0.1653: Amiga: default 'viewdir' may not work

Problem:    Amiga: default 'viewdir' may not work.
Solution:   Use "home:" instead of "$VIM". Add a test. (Christian Brabandt,
            closes #12576)
This commit is contained in:
Christian Brabandt 2023-06-23 22:23:01 +01:00 committed by Bram Moolenaar
parent bd32e8ad8d
commit b8b1c8ebd4
5 changed files with 22 additions and 3 deletions

View File

@ -8912,9 +8912,9 @@ A jump table for the options with a short description can be found at |Q_op|.
displayed when 'verbosefile' is set. displayed when 'verbosefile' is set.
*'viewdir'* *'vdir'* *'viewdir'* *'vdir'*
'viewdir' 'vdir' string (default for Amiga "$VIM/vimfiles/view", 'viewdir' 'vdir' string (default for Amiga "home:vimfiles/view",
for Win32: "$HOME/vimfiles/view", for Win32: "$HOME/vimfiles/view",
for Unix: "~/.vim/view", for Unix: "$HOME/.vim/view",
for macOS: "$VIM/vimfiles/view" for macOS: "$VIM/vimfiles/view"
for VMS: "sys$login:vimfiles/view") for VMS: "sys$login:vimfiles/view")
global global

View File

@ -199,7 +199,7 @@ typedef long off_t;
#endif #endif
#ifndef DFLT_VDIR #ifndef DFLT_VDIR
# define DFLT_VDIR "$VIM/vimfiles/view" // default for 'viewdir' # define DFLT_VDIR "home:vimfiles/view" // default for 'viewdir'
#endif #endif
#ifndef DFLT_MAXMEM #ifndef DFLT_MAXMEM

View File

@ -30,6 +30,10 @@ if 1
" Avoid storing shell history. " Avoid storing shell history.
let $HISTFILE = "" let $HISTFILE = ""
" Have current $HOME available as $ORIGHOME. $HOME is used for option
" defaults before we get here, and test_mksession checks that.
let $ORIGHOME = $HOME
" Make sure $HOME does not get read or written. " Make sure $HOME does not get read or written.
" It must exist, gnome tries to create $HOME/.gnome2 " It must exist, gnome tries to create $HOME/.gnome2
let $HOME = getcwd() . '/XfakeHOME' let $HOME = getcwd() . '/XfakeHOME'

View File

@ -1262,4 +1262,17 @@ func Test_mkview_manual_fold()
bw! bw!
endfunc endfunc
" Test default 'viewdir' value
func Test_mkview_default_home()
if has('win32')
call assert_match('^' .. $ORIGHOME .. '/vimfiles', &viewdir)
elseif has('unix')
call assert_match('^' .. $ORIGHOME .. '/.vim', &viewdir)
elseif has('amiga')
call assert_match('^home:vimfiles', &viewdir)
elseif has('mac')
call assert_match('^' .. $VIM .. '/vimfiles', &viewdir)
endif
endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab

View File

@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1653,
/**/ /**/
1652, 1652,
/**/ /**/