More realistic Vim error, and catch all normal exceptions.
This commit is contained in:
parent
655dd3e2be
commit
e42a430e64
@ -103,9 +103,10 @@ function! repeat#run(count)
|
|||||||
call feedkeys((a:count ? a:count : '') . '.', 'ni')
|
call feedkeys((a:count ? a:count : '') . '.', 'ni')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
catch /^Vim\%((\a\+)\)\=:E\%(384\|385\|486\)/
|
catch /^Vim(normal):/
|
||||||
echohl ErrorMsg | echo substitute(v:exception, '^Vim\%((\a\+)\)\=:', '', '') | echohl None
|
return 'echoerr v:errmsg'
|
||||||
endtry
|
endtry
|
||||||
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! repeat#wrap(command,count)
|
function! repeat#wrap(command,count)
|
||||||
@ -116,7 +117,7 @@ function! repeat#wrap(command,count)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
nnoremap <silent> <Plug>(RepeatDot) :<C-U>call repeat#run(v:count)<CR>
|
nnoremap <silent> <Plug>(RepeatDot) :<C-U>exe repeat#run(v:count)<CR>
|
||||||
nnoremap <silent> <Plug>(RepeatUndo) :<C-U>call repeat#wrap('u',v:count)<CR>
|
nnoremap <silent> <Plug>(RepeatUndo) :<C-U>call repeat#wrap('u',v:count)<CR>
|
||||||
nnoremap <silent> <Plug>(RepeatUndoLine) :<C-U>call repeat#wrap('U',v:count)<CR>
|
nnoremap <silent> <Plug>(RepeatUndoLine) :<C-U>call repeat#wrap('U',v:count)<CR>
|
||||||
nnoremap <silent> <Plug>(RepeatRedo) :<C-U>call repeat#wrap("\<Lt>C-R>",v:count)<CR>
|
nnoremap <silent> <Plug>(RepeatRedo) :<C-U>call repeat#wrap("\<Lt>C-R>",v:count)<CR>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user