From f1d0fbbdf4d77b73ba47146bada375223b3d733a Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Sat, 3 Nov 2012 19:37:05 +0200 Subject: [PATCH] Allow for some additional post-processing This commit makes the s:repeat function public as repeat#run to allow manual remapping for customization. --- autoload/repeat.vim | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/autoload/repeat.vim b/autoload/repeat.vim index df9a7fe..4cc5667 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -68,7 +68,7 @@ function! repeat#setreg(sequence,register) let g:repeat_reg = [a:sequence, a:register] endfunction -function! s:repeat(count) +function! repeat#run(count) if g:repeat_tick == b:changedtick let r = '' if g:repeat_reg[0] ==# g:repeat_sequence && !empty(g:repeat_reg[1]) @@ -84,10 +84,9 @@ function! s:repeat(count) let c = g:repeat_count let s = g:repeat_sequence let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : '')) - call feedkeys(r . cnt, 'n') - call feedkeys(s) + exe 'norm ' . r . cnt . s else - call feedkeys((a:count ? a:count : '') . '.', 'n') + exe 'norm! '.(a:count ? a:count : '') . '.' endif endfunction @@ -99,7 +98,7 @@ function! s:wrap(command,count) endif endfunction -nnoremap . :call repeat(v:count) +nnoremap . :call repeat#run(v:count) nnoremap u :call wrap('u',v:count) if maparg('U','n') ==# '' nnoremap U :call wrap('U',v:count)