Merge pull request #47 from orlp/master

Prevent stack trace of search errors.
This commit is contained in:
Tim Pope 2015-05-09 13:57:55 -04:00
commit 7a6675f092

View File

@ -74,6 +74,7 @@ function! repeat#setreg(sequence,register)
endfunction endfunction
function! repeat#run(count) function! repeat#run(count)
try
if g:repeat_tick == b:changedtick if g:repeat_tick == b:changedtick
let r = '' let r = ''
if g:repeat_reg[0] ==# g:repeat_sequence && !empty(g:repeat_reg[1]) if g:repeat_reg[0] ==# g:repeat_sequence && !empty(g:repeat_reg[1])
@ -102,6 +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(normal):/
return 'echoerr v:errmsg'
endtry
return ''
endfunction endfunction
function! repeat#wrap(command,count) function! repeat#wrap(command,count)
@ -112,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>