Reveal full hunk on :Gstatus CTRL-N

This commit is contained in:
Tim Pope
2019-01-03 16:33:44 -05:00
parent 9c74c0d0a7
commit acf3cb4400

View File

@@ -2057,10 +2057,24 @@ function! s:StageInfo(...) abort
\ 'index': index}
endfunction
function! s:StageReveal(...) abort
let begin = a:0 ? a:1 : line('.')
if getline(begin) =~# '^@'
let end = line(begin) + 1
while getline(end) =~# '^[ \+-]'
let end += 1
endwhile
while end > line('w$') && line('.') > line('w0') + &scrolloff
execute "normal! \<C-E>"
endwhile
endif
endfunction
function! s:StageNext(count) abort
for i in range(a:count)
call search('^[A-Z?] .\|^[0-9a-f]\{4,\} \|^@','W')
endfor
call s:StageReveal()
return '.'
endfunction
@@ -2071,6 +2085,7 @@ function! s:StagePrevious(count) abort
for i in range(a:count)
call search('^[A-Z?] .\|^[0-9a-f]\{4,\} \|^@','Wbe')
endfor
call s:StageReveal()
return '.'
endif
endfunction