]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1653: Amiga: default 'viewdir' may not work v9.0.1653
authorChristian Brabandt <cb@256bit.org>
Fri, 23 Jun 2023 21:23:01 +0000 (22:23 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 23 Jun 2023 21:23:01 +0000 (22:23 +0100)
Problem:    Amiga: default 'viewdir' may not work.
Solution:   Use "home:" instead of "$VIM". Add a test. (Christian Brabandt,
            closes #12576)

runtime/doc/options.txt
src/os_amiga.h
src/testdir/setup.vim
src/testdir/test_mksession.vim
src/version.c

index 6653807866062fce69996f8101235717890883a3..9292b05a4dadfb61fd14e69c5ab1730e60b66ef1 100644 (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.
 
                                                *'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 Unix: "~/.vim/view",
+                                        for Unix: "$HOME/.vim/view",
                                         for macOS: "$VIM/vimfiles/view"
                                         for VMS: "sys$login:vimfiles/view")
                        global
index 57417137a0f9c0a3b0f88a7fc6040cfc55e930b4..080b01637e74f37fdef35eefc1e4482077547506 100644 (file)
@@ -199,7 +199,7 @@ typedef long off_t;
 #endif
 
 #ifndef DFLT_VDIR
-# define DFLT_VDIR     "$VIM/vimfiles/view"    // default for 'viewdir'
+# define DFLT_VDIR     "home:vimfiles/view"    // default for 'viewdir'
 #endif
 
 #ifndef DFLT_MAXMEM
index ca94bae275aa122729e980aac318dcaa08deb701..0e5088ad2438479cd7ee2952468810e212c3ab13 100644 (file)
@@ -30,6 +30,10 @@ if 1
   " Avoid storing shell history.
   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.
   " It must exist, gnome tries to create $HOME/.gnome2
   let $HOME = getcwd() . '/XfakeHOME'
index 1ce5a28f5eb3cbf7391dc0fc5411b32dd1ea3b79..0c4838e6911d9f3fa29058096a1e00079380f3be 100644 (file)
@@ -1262,4 +1262,17 @@ func Test_mkview_manual_fold()
   bw!
 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
index 33169790e76fc138dbfdebf10bd57eb2c145fb04..931bd9718ba9e49788112a8e58ce78b890ba0e0b 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1653,
 /**/
     1652,
 /**/