mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0545: edit test may fail on some systems
Problem: Edit test may fail on some systems.
Solution: If creating a directory with a very long path fails, bail out.
15ecbd6f3d
This commit is contained in:
parent
3ff1907593
commit
bbf00120f7
@ -1324,22 +1324,31 @@ func Test_edit_quit()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_edit_complete_very_long_name()
|
func Test_edit_complete_very_long_name()
|
||||||
if !has('unix') || has('mac')
|
if !has('unix')
|
||||||
" Long directory names only work on Unix.
|
" Long directory names only work on Unix.
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let dirname = getcwd() . "/Xdir"
|
||||||
|
let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
|
||||||
|
try
|
||||||
|
call mkdir(longdirname, 'p')
|
||||||
|
catch /E739:/
|
||||||
|
" Long directory name probably not supported.
|
||||||
|
call delete(dirname, 'rf')
|
||||||
|
return
|
||||||
|
endtry
|
||||||
|
|
||||||
" Try to get the Vim window position before setting 'columns'.
|
" Try to get the Vim window position before setting 'columns'.
|
||||||
let winposx = getwinposx()
|
let winposx = getwinposx()
|
||||||
let winposy = getwinposy()
|
let winposy = getwinposy()
|
||||||
let save_columns = &columns
|
let save_columns = &columns
|
||||||
|
" Need at least about 1100 columns to reproduce the problem.
|
||||||
set columns=2000
|
set columns=2000
|
||||||
call assert_equal(2000, &columns)
|
call assert_equal(2000, &columns)
|
||||||
set noswapfile
|
set noswapfile
|
||||||
|
|
||||||
let dirname = getcwd() . "/Xdir"
|
|
||||||
let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
|
|
||||||
let longfilename = longdirname . '/' . repeat('a', 255)
|
let longfilename = longdirname . '/' . repeat('a', 255)
|
||||||
call mkdir(longdirname, 'p')
|
|
||||||
call writefile(['Totum', 'Table'], longfilename)
|
call writefile(['Totum', 'Table'], longfilename)
|
||||||
new
|
new
|
||||||
exe "next Xfile " . longfilename
|
exe "next Xfile " . longfilename
|
||||||
|
Loading…
Reference in New Issue
Block a user