Respect 'foldopen' on undo

Closes #9.
This commit is contained in:
Tim Pope 2012-08-22 11:30:12 -04:00
parent d75a544b78
commit 613eb1c812

View File

@ -93,7 +93,7 @@ endfunction
function! s:wrap(command,count) function! s:wrap(command,count)
let preserve = (g:repeat_tick == b:changedtick) let preserve = (g:repeat_tick == b:changedtick)
exe 'norm! '.(a:count ? a:count : '').a:command exe 'norm! '.(a:count ? a:count : '').a:command . (&foldopen =~# 'undo' ? 'zv' : '')
if preserve if preserve
let g:repeat_tick = b:changedtick let g:repeat_tick = b:changedtick
endif endif