Fix false positive matching filename in blame

This commit is contained in:
Tim Pope
2019-11-30 17:13:16 -05:00
parent 3b1da8b217
commit 6d9dd103c0

View File

@@ -4815,7 +4815,7 @@ function! s:BlameCommitFileLnum(...) abort
let commit = get(s:LinesError('rev-list', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, '')
endif
let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)')
let path = matchstr(line, '^\^\=[?*]*\x* \+\%(\d\+ \+\d\+ \+\)\=\zs.\{-\}\ze\s\+\%(\%( \d\+ \)\@<!([^()]*\w \d\+)\|\d\+ \)')
let path = matchstr(line, '^\^\=[?*]*\x* \+\%(\d\+ \+\d\+ \+\)\=\zs.\{-\}\ze\s*\d\+ \%((\| *\d\+)\)')
if empty(path) && lnum
let path = get(state, 'blame_file', '')
endif