Closed Konfekt closed 9 years ago
From what I see, undoclosewin uses a different method. I'll see what I can do.
Hmm, undoclosewin seems to work in a more complicated way than I expected. It listens to the BufWinLeave
event, but that one gets fired even when you're editing a new buffer in the same window :/. I guess this is why the internals of the plugin do some duplicate checks, although I'm not so sure how reliable they end up being...
Either way, this would be pretty complicated to support, so I think I won't implement it. In my experiments, ZZ
works fine, it's only <c-w>c
that doesn't throw a QuitPre
autocommand. One way to get this working for you would be to remap <c-w>c
:
nnoremap <c-w>c :call undoquit#SaveWindowQuitHistory()<cr><c-w>c
This seems to work for me, but I wouldn't put it in the plugin, since I don't want to override someone's mappings. Maybe I'll write it down as a tip in the documentation.
The undoclosewin.vim plugin also restores windows closed by commands such as
<c-w>c
orZZ
. Is it outside of the scope of undoquit.vim or is it impossible to implement this reliably ?If not, how about allowing undoquit to undo closes of windows by such commands as well (perhaps by taking a look at undoclosewin.vim's implementation) ?