mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 02:00:05 +08:00
fix(startup): fix parser_argv function
This commit is contained in:
parent
b3bcf07fba
commit
2ad0bb02b3
@ -1606,6 +1606,19 @@ function! s:parser_argv() abort
|
|||||||
else
|
else
|
||||||
if !argc() && line2byte('$') == -1
|
if !argc() && line2byte('$') == -1
|
||||||
return [0]
|
return [0]
|
||||||
|
elseif argv()[0] =~# '/$'
|
||||||
|
let f = fnamemodify(expand(argv()[0]), ':p')
|
||||||
|
if isdirectory(f)
|
||||||
|
return [1, f]
|
||||||
|
else
|
||||||
|
return [1, getcwd()]
|
||||||
|
endif
|
||||||
|
elseif argv()[0] ==# '.'
|
||||||
|
return [1, getcwd()]
|
||||||
|
elseif isdirectory(expand(argv()[0]))
|
||||||
|
return [1, fnamemodify(expand(argv()[0]), ':p')]
|
||||||
|
else
|
||||||
|
return [2, string(argv())]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user