mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	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)
b8b1c8ebd4
Cherry-pick Test_mkview_manual_fold() changes from 9.0.{0363,0626}.
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 827cfe4a76)
			
			
This commit is contained in:
		
				
					committed by
					
						
						github-actions[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							12298be0fe
						
					
				
				
					commit
					a97713485d
				
			@@ -109,6 +109,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user