mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-11 12:53:52 -05:00
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:
@@ -195,7 +195,7 @@ function! fugitive#detect(path) abort
|
|||||||
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
|
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
|
||||||
endif
|
endif
|
||||||
let buffer = fugitive#buffer()
|
let buffer = fugitive#buffer()
|
||||||
if expand('%:p') =~# '//'
|
if expand('%:p') =~# '://'
|
||||||
call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))
|
call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))
|
||||||
endif
|
endif
|
||||||
if stridx(buffer.getvar('&tags'), escape(b:git_dir, ', ')) == -1
|
if stridx(buffer.getvar('&tags'), escape(b:git_dir, ', ')) == -1
|
||||||
|
|||||||
Reference in New Issue
Block a user