Don't detect incorrect root on fake paths
For example, fugitive buffers were getting detected using the current working directory.
This commit is contained in:
parent
cb1ebfbc5b
commit
9552ad6e23
@ -54,7 +54,7 @@ function! classpath#detect(...) abort
|
||||
let root = simplify(fnamemodify(bufname(buffer), ':p:s?[\/]$??'))
|
||||
endif
|
||||
|
||||
if root =~# '^zipfile:'
|
||||
if !isdirectory(fnamemodify(root, ':h'))
|
||||
return default
|
||||
endif
|
||||
|
||||
|
@ -848,9 +848,12 @@ augroup END
|
||||
|
||||
function! s:hunt(start, anchor) abort
|
||||
let root = simplify(fnamemodify(a:start, ':p:s?[\/]$??'))
|
||||
if !isdirectory(fnamemodify(root, ':p'))
|
||||
return ''
|
||||
endif
|
||||
let previous = ""
|
||||
while root !=# previous
|
||||
if filereadable(root . '/' .a:anchor) && isdirectory(root . '/src')
|
||||
if filereadable(root . '/' . a:anchor) && isdirectory(root . '/src')
|
||||
return root
|
||||
endif
|
||||
let previous = root
|
||||
|
Loading…
Reference in New Issue
Block a user