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 '' return ''
endif endif
let path = substitute(fnamemodify(bufname(buffer), ':p'), '\C^zipfile:\(.*\)::', '\1/', '') let path = substitute(fnamemodify(bufname(buffer), ':p'), '\C^zipfile:\(.*\)::', '\1/', '')
if exists('*classpath#from_vim') for dir in fireplace#path(buffer)
for dir in classpath#split(classpath#from_vim(getbufvar(buffer, '&path'))) if dir !=# '' && path[0 : strlen(dir)-1] ==# dir && path[strlen(dir)] =~# '[\/]'
if dir !=# '' && path[0 : strlen(dir)-1] ==# dir
return path[strlen(dir)+1:-1] return path[strlen(dir)+1:-1]
endif endif
endfor endfor
endif
return '' return ''
endfunction endfunction