neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 827cfe4a764414b91062f7dad8699ef85701fc6d
parent b4c759716a9e945b41439ae6d686c81107115516
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Fri, 18 Apr 2025 07:59:59 +0800

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 vim/vim#12576)

https://github.com/vim/vim/commit/b8b1c8ebd4e62d4567aa16b57b25823b80bfc76f

Cherry-pick Test_mkview_manual_fold() changes from 9.0.{0363,0626}.

Co-authored-by: Christian Brabandt <cb@256bit.org>

Diffstat:
Mtest/old/testdir/setup.vim | 4++++
Mtest/old/testdir/test_mksession.vim | 19++++++++++++++++---
2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim @@ -110,6 +110,10 @@ if executable('gem') let $GEM_PATH = system('gem env gempath') endif +" 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. let $HOME = expand(getcwd() . '/XfakeHOME') if !isdirectory($HOME) diff --git a/test/old/testdir/test_mksession.vim b/test/old/testdir/test_mksession.vim @@ -1170,8 +1170,8 @@ endfunc " Test for creating views with manual folds func Test_mkview_manual_fold() - call writefile(range(1,10), 'Xfile') - new Xfile + call writefile(range(1,10), 'Xmkvfile', 'D') + new Xmkvfile " create recursive folds 5,6fold 4,7fold @@ -1194,9 +1194,22 @@ func Test_mkview_manual_fold() source Xview call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4), \ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)]) - call delete('Xfile') call delete('Xview') bw! endfunc +" Test default 'viewdir' value +func Test_mkview_default_home() + throw 'Skipped: N/A' + 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