Prevent stack trace of search errors.
This commit is contained in:
parent
c4f9f159e6
commit
655dd3e2be
@ -74,34 +74,38 @@ function! repeat#setreg(sequence,register)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! repeat#run(count)
|
function! repeat#run(count)
|
||||||
if g:repeat_tick == b:changedtick
|
try
|
||||||
let r = ''
|
if g:repeat_tick == b:changedtick
|
||||||
if g:repeat_reg[0] ==# g:repeat_sequence && !empty(g:repeat_reg[1])
|
let r = ''
|
||||||
if g:repeat_reg[1] ==# '='
|
if g:repeat_reg[0] ==# g:repeat_sequence && !empty(g:repeat_reg[1])
|
||||||
" This causes a re-evaluation of the expression on repeat, which
|
if g:repeat_reg[1] ==# '='
|
||||||
" is what we want.
|
" This causes a re-evaluation of the expression on repeat, which
|
||||||
let r = '"=' . getreg('=', 1) . "\<CR>"
|
" is what we want.
|
||||||
|
let r = '"=' . getreg('=', 1) . "\<CR>"
|
||||||
|
else
|
||||||
|
let r = '"' . g:repeat_reg[1]
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
let c = g:repeat_count
|
||||||
|
let s = g:repeat_sequence
|
||||||
|
let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : ''))
|
||||||
|
if ((v:version == 703 && has('patch100')) || (v:version == 704 && !has('patch601')))
|
||||||
|
exe 'norm ' . r . cnt . s
|
||||||
else
|
else
|
||||||
let r = '"' . g:repeat_reg[1]
|
call feedkeys(s, 'i')
|
||||||
|
call feedkeys(r . cnt, 'ni')
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if ((v:version == 703 && has('patch100')) || (v:version == 704 && !has('patch601')))
|
||||||
|
exe 'norm! '.(a:count ? a:count : '') . '.'
|
||||||
|
else
|
||||||
|
call feedkeys((a:count ? a:count : '') . '.', 'ni')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E\%(384\|385\|486\)/
|
||||||
let c = g:repeat_count
|
echohl ErrorMsg | echo substitute(v:exception, '^Vim\%((\a\+)\)\=:', '', '') | echohl None
|
||||||
let s = g:repeat_sequence
|
endtry
|
||||||
let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : ''))
|
|
||||||
if ((v:version == 703 && has('patch100')) || (v:version == 704 && !has('patch601')))
|
|
||||||
exe 'norm ' . r . cnt . s
|
|
||||||
else
|
|
||||||
call feedkeys(s, 'i')
|
|
||||||
call feedkeys(r . cnt, 'ni')
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
if ((v:version == 703 && has('patch100')) || (v:version == 704 && !has('patch601')))
|
|
||||||
exe 'norm! '.(a:count ? a:count : '') . '.'
|
|
||||||
else
|
|
||||||
call feedkeys((a:count ? a:count : '') . '.', 'ni')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! repeat#wrap(command,count)
|
function! repeat#wrap(command,count)
|
||||||
|
Loading…
Reference in New Issue
Block a user