mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 22:40:04 +08:00
fix(startup): fix parser_argv function
close https://github.com/SpaceVim/SpaceVim/issues/4610
This commit is contained in:
parent
9737ef4218
commit
4d04e3ff96
@ -1557,11 +1557,14 @@ endfunction
|
|||||||
" status: 0 : no argv
|
" status: 0 : no argv
|
||||||
" 1 : dir
|
" 1 : dir
|
||||||
" 2 : default arguments
|
" 2 : default arguments
|
||||||
|
"
|
||||||
|
" argc() return number of files
|
||||||
|
" argv() return a list of files/directories
|
||||||
function! s:parser_argv() abort
|
function! s:parser_argv() abort
|
||||||
if !exists('v:argv')
|
if !exists('v:argv')
|
||||||
\ || (len(v:argv) >=# 3 && index(v:argv, '--embed') ==# -1)
|
\ || (len(v:argv) >=# 3 && index(v:argv, '--embed') ==# -1)
|
||||||
" or do not support v:argv
|
" or do not support v:argv
|
||||||
return [2, get(v:, 'argv', ['failed to get v:argv'])]
|
return [0, get(v:, 'argv', ['failed to get v:argv'])]
|
||||||
elseif len(v:argv) ==# 1 || index(v:argv, '--embed') !=# -1
|
elseif len(v:argv) ==# 1 || index(v:argv, '--embed') !=# -1
|
||||||
" if there is no arguments
|
" if there is no arguments
|
||||||
" or use embed nvim
|
" or use embed nvim
|
||||||
|
Loading…
Reference in New Issue
Block a user