From b5e7e1ba2412980c80dceaff02fb635b7e5ba559 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 16 Aug 2021 18:25:42 -0400 Subject: [PATCH] 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. --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 04e1695..c475042 100644 --- 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]