Support buffer path without classpath.vim

This commit is contained in:
Tim Pope 2014-01-17 05:25:03 -05:00
parent 64f0ae7bbe
commit a568535bcd
1 changed files with 5 additions and 7 deletions

View File

@ -1063,13 +1063,11 @@ function! s:buffer_path(...) abort
return ''
endif
let path = substitute(fnamemodify(bufname(buffer), ':p'), '\C^zipfile:\(.*\)::', '\1/', '')
if exists('*classpath#from_vim')
for dir in classpath#split(classpath#from_vim(getbufvar(buffer, '&path')))
if dir !=# '' && path[0 : strlen(dir)-1] ==# dir
for dir in fireplace#path(buffer)
if dir !=# '' && path[0 : strlen(dir)-1] ==# dir && path[strlen(dir)] =~# '[\/]'
return path[strlen(dir)+1:-1]
endif
endfor
endif
return ''
endfunction