mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-12-07 20:54:33 +08:00
Reveal full hunk on :Gstatus CTRL-N
This commit is contained in:
@@ -2057,10 +2057,24 @@ function! s:StageInfo(...) abort
|
|||||||
\ 'index': index}
|
\ 'index': index}
|
||||||
endfunction
|
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
|
function! s:StageNext(count) abort
|
||||||
for i in range(a:count)
|
for i in range(a:count)
|
||||||
call search('^[A-Z?] .\|^[0-9a-f]\{4,\} \|^@','W')
|
call search('^[A-Z?] .\|^[0-9a-f]\{4,\} \|^@','W')
|
||||||
endfor
|
endfor
|
||||||
|
call s:StageReveal()
|
||||||
return '.'
|
return '.'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -2071,6 +2085,7 @@ function! s:StagePrevious(count) abort
|
|||||||
for i in range(a:count)
|
for i in range(a:count)
|
||||||
call search('^[A-Z?] .\|^[0-9a-f]\{4,\} \|^@','Wbe')
|
call search('^[A-Z?] .\|^[0-9a-f]\{4,\} \|^@','Wbe')
|
||||||
endfor
|
endfor
|
||||||
|
call s:StageReveal()
|
||||||
return '.'
|
return '.'
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user