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?[\/]$??'))
|
let root = simplify(fnamemodify(bufname(buffer), ':p:s?[\/]$??'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if root =~# '^zipfile:'
|
if !isdirectory(fnamemodify(root, ':h'))
|
||||||
return default
|
return default
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -848,9 +848,12 @@ augroup END
|
|||||||
|
|
||||||
function! s:hunt(start, anchor) abort
|
function! s:hunt(start, anchor) abort
|
||||||
let root = simplify(fnamemodify(a:start, ':p:s?[\/]$??'))
|
let root = simplify(fnamemodify(a:start, ':p:s?[\/]$??'))
|
||||||
|
if !isdirectory(fnamemodify(root, ':p'))
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
let previous = ""
|
let previous = ""
|
||||||
while root !=# previous
|
while root !=# previous
|
||||||
if filereadable(root . '/' .a:anchor) && isdirectory(root . '/src')
|
if filereadable(root . '/' . a:anchor) && isdirectory(root . '/src')
|
||||||
return root
|
return root
|
||||||
endif
|
endif
|
||||||
let previous = root
|
let previous = root
|
||||||
|
Loading…
Reference in New Issue
Block a user