From 444ba9fda5d05aa14c7e8664fa4a66a59c62a550 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Fri, 3 Feb 2017 08:04:54 -0800 Subject: [PATCH] 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. --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 576dda1..91d9685 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -195,7 +195,7 @@ function! fugitive#detect(path) abort nnoremap y :call setreg(v:register, recall()) 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