One last fix attempt before I revert everything

References: https://github.com/tpope/vim-repeat/issues/63
This commit is contained in:
Tim Pope 2024-07-08 17:22:29 -04:00
parent 5bd4c87a14
commit 65846025c1

View file

@ -124,9 +124,9 @@ function! repeat#errmsg()
endfunction
function! repeat#wrap(command,count)
exe (&foldopen =~# 'undo\|all' ? 'norm! zv' : '')
let preserve = (g:repeat_tick == b:changedtick)
return (a:count ? a:count : '') . a:command . (preserve ? ":let g:repeat_tick = b:changedtick\r" : '')
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
endfunction
nnoremap <silent> <Plug>(RepeatDot) :<C-U>if !repeat#run(v:count)<Bar>echoerr repeat#errmsg()<Bar>endif<CR>