mirror of
https://github.com/tpope/vim-repeat.git
synced 2026-09-10 07:16:26 -04:00
Cleaner solution due to lacygoill.
This commit is contained in:
parent
a307f8ae0c
commit
7216fe3a29
|
|
@ -136,10 +136,13 @@ endfunction
|
|||
|
||||
function! repeat#wrap(command,count)
|
||||
let preserve = (g:repeat_tick == b:changedtick)
|
||||
call feedkeys((a:count ? a:count : '').a:command, 'nx')
|
||||
call feedkeys((a:count ? a:count : '').a:command, 'n')
|
||||
exe (&foldopen =~# 'undo\|all' ? 'norm! zv' : '')
|
||||
if preserve
|
||||
let g:repeat_tick = b:changedtick
|
||||
augroup repeat_preserve_after_undo
|
||||
autocmd!
|
||||
autocmd TextChanged <buffer> let g:repeat_tick = b:changedtick | autocmd! repeat_preserve_after_undo
|
||||
augroup END
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue