Accept a count with :Gstatus <C-N>/<C-P>

This commit is contained in:
Tim Pope 2012-09-07 01:07:54 -04:00
parent b5725c1eec
commit 8d019de97c

View File

@ -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 <buffer> P
nunmap <buffer> ~
nnoremap <buffer> <silent> <C-N> :call search('^#\t.*','W')<Bar>.<CR>
nnoremap <buffer> <silent> <C-P> :call search('^#\t.*','Wbe')<Bar>.<CR>
nnoremap <buffer> <silent> <C-N> :<C-U>execute <SID>StageNext(v:count1)<CR>
nnoremap <buffer> <silent> <C-P> :<C-U>execute <SID>StagePrevious(v:count1)<CR>
nnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line('.'),line('.')+v:count1-1)<CR>
xnoremap <buffer> <silent> - :<C-U>execute <SID>StageToggle(line("'<"),line("'>"))<CR>
nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe <SID>BufReadIndex()<CR>