Fix [c from the first hunk of a file

This makes the rest of the function operate on the previous file rather
than the file of the hunk under the cursor.
This commit is contained in:
yut23
2022-07-20 22:37:21 -04:00
committed by Tim Pope
parent d84582d5f7
commit 4e11f9dabf

View File

@@ -4611,6 +4611,9 @@ endfunction
function! s:PreviousHunk(count) abort
for i in range(a:count)
if &filetype ==# 'fugitive'
if getline('.') =~# '^@' && getline(line('.') - 1) =~# s:file_pattern
-
endif
let lnum = search(s:file_pattern . '\|^@','Wbn')
call s:StageInline('show', lnum)
call search('^? .\|^@','Wb')