commit b5e7e1ba2412980c80dceaff02fb635b7e5ba559 (tree)
parent f3e92c7721505a59738db15e3e80bc5ccff08e36
Author: Tim Pope <code@tpope.net>
Date: Mon, 16 Aug 2021 18:25:42 -0400
Don't match :0: as line number in :Ggrep
This is explicitly to help with false positives in surrounding context
while grepping this very file, as :0: is used in numerous places to
reference blobs in the index. We also use :1: and company in a few
places, but a robust fix is much harder.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -5031,7 +5031,7 @@ endfunction
function! s:GrepParseLine(prefix, name_only, dir, line) abort
let entry = {'valid': 1}
- let match = matchlist(a:line, '^\(.\{-\}\):\(\d\+\):\(\d\+:\)\=\(.*\)$')
+ let match = matchlist(a:line, '^\(.\{-\}\):\([1-9]\d*\):\([1-9]\d*:\)\=\(.*\)$')
if len(match)
let entry.module = match[1]
let entry.lnum = +match[2]