mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 13:23:52 -05:00
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.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user