Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugin/sleuth.vim
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ function! s:detect() abort
call filter(patterns, 'v:val !~# "/"')
let dir = expand('%:p:h')
while isdirectory(dir) && dir !=# fnamemodify(dir, ':h') && c > 0
" the user home dir and the root dir likely contain a collection of files
" from different origins that do not provide any useful insight
if dir == expand('~') || dir == '/'
break
endif
for pattern in patterns
for neighbor in split(glob(dir.'/'.pattern), "\n")[0:7]
if neighbor !=# expand('%:p') && filereadable(neighbor)
Expand Down