mirror of
https://github.com/tpope/vim-repeat.git
synced 2026-09-10 07:16:26 -04:00
fix: undo inserting 'zv' when used via <C-O> in insert mode
This commit is contained in:
parent
65846025c1
commit
b5b2192256
|
|
@ -123,10 +123,18 @@ function! repeat#errmsg()
|
|||
return s:errmsg
|
||||
endfunction
|
||||
|
||||
function! repeat#wrapped(command, count)
|
||||
execute 'normal! ' . (a:count ? a:count : '') . a:command
|
||||
if g:repeat_tick == b:changedtick
|
||||
let g:repeat_tick = b:changedtick
|
||||
endif
|
||||
if &foldopen =~# 'undo\|all'
|
||||
normal! zv
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! repeat#wrap(command,count)
|
||||
let foldopen = &foldopen =~# 'undo\|all' ? 'zv' : ''
|
||||
let preserve = g:repeat_tick == b:changedtick ? ":let g:repeat_tick = b:changedtick\r" : ''
|
||||
return (a:count ? a:count : '') . a:command . preserve . foldopen
|
||||
return printf(":\<C-U>call repeat#wrapped(%s, %d)\<CR>", string(a:command), a:count)
|
||||
endfunction
|
||||
|
||||
nnoremap <silent> <Plug>(RepeatDot) :<C-U>if !repeat#run(v:count)<Bar>echoerr repeat#errmsg()<Bar>endif<CR>
|
||||
|
|
|
|||
Loading…
Reference in a new issue