From 8d019de97c2ea4b0fdb17cb785192be4e81e55e9 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 7 Sep 2012 01:07:54 -0400 Subject: [PATCH] Accept a count with :Gstatus / --- plugin/fugitive.vim | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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()