diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 3eb81c9..d741029 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -698,6 +698,20 @@ function! s:stage_info(lnum) abort endif endfunction +function! s:StageNext(count) + for i in range(a:count) + call search('^#\t.*','W') + endfor + return '.' +endfunction + +function! s:StagePrevious(count) + for i in range(a:count) + call search('^#\t.*','Wbe') + endfor + return '.' +endfunction + function! s:StageReloadSeek(target,lnum1,lnum2) let jump = a:target let f = matchstr(getline(a:lnum1-1),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.*') @@ -2000,8 +2014,8 @@ function! s:BufReadIndex() call s:JumpInit() nunmap P nunmap ~ - nnoremap :call search('^#\t.*','W'). - nnoremap :call search('^#\t.*','Wbe'). + nnoremap :execute StageNext(v:count1) + nnoremap :execute StagePrevious(v:count1) nnoremap - :execute StageToggle(line('.'),line('.')+v:count1-1) xnoremap - :execute StageToggle(line("'<"),line("'>")) nnoremap a :let b:fugitive_display_format += 1exe BufReadIndex()