From e42a430e644f68a8d7da32425158600fb48ab8cd Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Thu, 23 Apr 2015 01:45:15 +0200 Subject: [PATCH] More realistic Vim error, and catch all normal exceptions. --- autoload/repeat.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/autoload/repeat.vim b/autoload/repeat.vim index 245a189..8fd9df5 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -103,9 +103,10 @@ function! repeat#run(count) call feedkeys((a:count ? a:count : '') . '.', 'ni') endif endif - catch /^Vim\%((\a\+)\)\=:E\%(384\|385\|486\)/ - echohl ErrorMsg | echo substitute(v:exception, '^Vim\%((\a\+)\)\=:', '', '') | echohl None + catch /^Vim(normal):/ + return 'echoerr v:errmsg' endtry + return '' endfunction function! repeat#wrap(command,count) @@ -116,7 +117,7 @@ function! repeat#wrap(command,count) endif endfunction -nnoremap (RepeatDot) :call repeat#run(v:count) +nnoremap (RepeatDot) :exe repeat#run(v:count) 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)