Restore unfolding during undo

References: https://github.com/tpope/vim-repeat/issues/63
This commit is contained in:
Tim Pope 2024-07-08 10:12:33 -04:00
parent a89a4d0760
commit 5bd4c87a14

View file

@ -124,6 +124,7 @@ 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" : '')
endfunction