mtth / scratch.vim

Unobtrusive scratch window
MIT License
395 stars 32 forks source link

Scratch.vim doesn't exit cleanly on winleave #12

Closed mtglsk closed 9 years ago

mtglsk commented 9 years ago

I have some autocmd's on winenter and winleave, which afaik don't work with your plugin.

autocmd WinLeave * set cul autocmd WinEnter * set nocul

mtth commented 9 years ago

Indeed, I can reproduce this. I'll think about how best to can change the way the auto-closing is handled.

If you're curious I believe this happens because by default autocmds don't trigger recursively (more details here - autocmd-nested).

mtth commented 9 years ago

Fixed in 187d1d5fe4437e6af908c18b94e06ffa9414c6a5. Let me know if you run into any issues.

Note that for your autocmds to work reliably (e.g. also with split) you should change them to:

autocmd VimEnter,WinEnter,BufWinEnter * set cul
autocmd WinLeave * set nocul
mtglsk commented 9 years ago

Works great! Very much thanks!