Stricter match for fugitive:// buffers (#872)

Fixes #871

It is valid - though odd - to open a file at `some//path`. In that case
the current check for fugitive buffers matches and changes &path
unexpectedly. A stricter match against `://` prevents this.
This commit is contained in:
Nate Bosch
2017-02-03 08:04:54 -08:00
committed by Tim Pope
parent b754bc2031
commit 444ba9fda5

View File

@@ -195,7 +195,7 @@ function! fugitive#detect(path) abort
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
endif
let buffer = fugitive#buffer()
if expand('%:p') =~# '//'
if expand('%:p') =~# '://'
call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))
endif
if stridx(buffer.getvar('&tags'), escape(b:git_dir, ', ')) == -1