diff --git a/autoload/repeat.vim b/autoload/repeat.vim index 708c318..97fea24 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -86,6 +86,7 @@ function! s:default_register() endfunction function! repeat#run(count) + let s:errmsg = '' try if g:repeat_tick == b:changedtick let r = '' @@ -124,9 +125,13 @@ function! repeat#run(count) endif endif catch /^Vim(normal):/ - return 'echoerr v:errmsg' + let s:errmsg = v:errmsg + return 0 endtry - return '' + return 1 +endfunction +function! repeat#errmsg() + return s:errmsg endfunction function! repeat#wrap(command,count) @@ -138,7 +143,7 @@ function! repeat#wrap(command,count) endif endfunction -nnoremap (RepeatDot) :exe repeat#run(v:count) +nnoremap (RepeatDot) :if !repeat#run(v:count)echoerr repeat#errmsg()endif nnoremap (RepeatUndo) :call repeat#wrap('u',v:count) nnoremap (RepeatUndoLine) :call repeat#wrap('U',v:count) nnoremap (RepeatRedo) :call repeat#wrap("\C-R>",v:count)