Fix #480: simplify paths
This commit is contained in:
parent
6bcff44f05
commit
3494d32a67
@ -540,10 +540,12 @@ function! s:get_main_from_specifier(spec) " {{{1
|
|||||||
if l:filename[0] ==# '/'
|
if l:filename[0] ==# '/'
|
||||||
if filereadable(l:filename) | return l:filename | endif
|
if filereadable(l:filename) | return l:filename | endif
|
||||||
else
|
else
|
||||||
for l:candidate in [
|
" The candidate may be relative both to the current buffer file and to
|
||||||
\ expand('%:p:h') . '/' . l:filename,
|
" the working directory (for subfile package)
|
||||||
\ fnamemodify(getcwd(), ':p') . '/' . l:filename
|
for l:candidate in map([
|
||||||
\]
|
\ expand('%:p:h'),
|
||||||
|
\ getcwd()],
|
||||||
|
\ 'simplify(v:val . ''/'' . l:filename)')
|
||||||
if filereadable(l:candidate) | return l:candidate | endif
|
if filereadable(l:candidate) | return l:candidate | endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user