Fix -1 effectively canceling --reverse

Is there a way to apply a limit at the print level rather than the query
level?
This commit is contained in:
Tim Pope 2019-08-13 17:12:24 -04:00
parent 08a9a45dbc
commit 8038ee60a9

View File

@ -4596,7 +4596,7 @@ function! s:BlameCommitFileLnum(...) abort
if commit =~# '^0\+$' if commit =~# '^0\+$'
let commit = '' let commit = ''
elseif line !~# '^\^' && has_key(state, 'blame_reverse_end') elseif line !~# '^\^' && has_key(state, 'blame_reverse_end')
let commit = get(s:LinesError('log', '--pretty=format:%H', '-1', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, commit) let commit = get(s:LinesError('log', '--pretty=format:%H', '--ancestry-path', '--reverse', commit . '..' . state.blame_reverse_end)[0], 0, commit)
endif endif
let lnum = +matchstr(line, ' \zs\d\+\ze \%((\| *\d\+)\)') 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\+ \)\@<!([^()]*\w \d\+)\|\d\+ \)')