1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 02:05:40 +08:00

Ignore home directory when find dir (#3923)

This commit is contained in:
Wang Shidong 2020-10-24 12:07:59 +08:00 committed by GitHub
parent ce73df6fc5
commit 4db31814e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,7 +231,7 @@ function! s:find_root_directory() abort
" @question confused about expand and fnamemodify " @question confused about expand and fnamemodify
" ref: https://github.com/vim/vim/issues/6793 " ref: https://github.com/vim/vim/issues/6793
" get the current path of buffer or working dir " get the current path of buffer or working dir
let fd = expand('%:p') let fd = expand('%:p')
@ -257,8 +257,6 @@ function! s:find_root_directory() abort
endif endif
let path_type = getftype(find_path) let path_type = getftype(find_path)
if ( path_type ==# 'dir' || path_type ==# 'file' ) if ( path_type ==# 'dir' || path_type ==# 'file' )
\ && find_path !=# expand('~/.SpaceVim.d/')
\ && find_path !=# expand('~/.Rprofile')
\ && !s:is_ignored_dir(find_path) \ && !s:is_ignored_dir(find_path)
let find_path = s:FILE.unify_path(find_path, ':p') let find_path = s:FILE.unify_path(find_path, ':p')
if path_type ==# 'dir' if path_type ==# 'dir'
@ -266,8 +264,10 @@ function! s:find_root_directory() abort
else else
let dir = s:FILE.unify_path(find_path, ':h') let dir = s:FILE.unify_path(find_path, ':h')
endif endif
call s:LOGGER.info(' (' . pattern . '):' . dir) if dir !=# s:FILE.unify_path(expand('$HOME'))
call add(dirs, dir) call s:LOGGER.info(' (' . pattern . '):' . dir)
call add(dirs, dir)
endif
endif endif
endfor endfor
return s:sort_dirs(deepcopy(dirs)) return s:sort_dirs(deepcopy(dirs))