mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 22:40:04 +08:00
disable autochange dir - fix option
This commit is contained in:
parent
5a5cd8280b
commit
ee7e5b6af1
@ -915,7 +915,6 @@ function! SpaceVim#begin() abort
|
||||
augroup END
|
||||
else
|
||||
call SpaceVim#logger#info('Startup with argv: ' . string(s:status[1]) )
|
||||
call SpaceVim#plugins#projectmanager#current_root()
|
||||
endif
|
||||
call SpaceVim#default#options()
|
||||
call SpaceVim#default#layers()
|
||||
|
@ -81,8 +81,14 @@ endfunction
|
||||
function! SpaceVim#plugins#projectmanager#current_root() abort
|
||||
let rootdir = getbufvar('%', 'rootDir', '')
|
||||
if empty(rootdir)
|
||||
let rootdir = s:change_to_root_directory()
|
||||
else
|
||||
let rootdir = s:find_root_directory()
|
||||
if empty(rootdir)
|
||||
let rootdir = getcwd()
|
||||
endif
|
||||
call setbufvar('%', 'rootDir', rootdir)
|
||||
endif
|
||||
if !empty(rootdir) && g:spacevim_project_rooter_automatically
|
||||
echo g:spacevim_project_rooter_automatically
|
||||
call s:change_dir(rootdir)
|
||||
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
|
||||
endif
|
||||
@ -160,9 +166,7 @@ function! s:sort_dirs(dirs) abort
|
||||
else
|
||||
let dir = fnamemodify(dir, ':p:h')
|
||||
endif
|
||||
call s:change_dir(dir)
|
||||
call setbufvar('%', 'rootDir', getcwd())
|
||||
return b:rootDir
|
||||
return dir
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -170,12 +174,5 @@ function! s:compare(d1, d2) abort
|
||||
return len(split(a:d2, '/')) - len(split(a:d1, '/'))
|
||||
endfunction
|
||||
|
||||
function! s:change_to_root_directory() abort
|
||||
if !empty(s:find_root_directory())
|
||||
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
|
||||
endif
|
||||
return getbufvar('%', 'rootDir', '')
|
||||
endfunction
|
||||
|
||||
|
||||
" vim:set et nowrap sw=2 cc=80:
|
||||
|
Loading…
Reference in New Issue
Block a user