Don't close ghost text buffer on BufLeave because this event happens so frequently.
It's inconvenient that users cannot move around buffers to yank text and go to temporary buffers such as denite, telescope and so on.
Don't remove autocmd on closing because the autocmd is automatically removed when the buffer is wiped out.
Instead, I added bufexists() check to ensure that the buffer to be deleted exists.
This PR includes following changes.
BufLeave
because this event happens so frequently. It's inconvenient that users cannot move around buffers to yank text and go to temporary buffers such as denite, telescope and so on.bufexists()
check to ensure that the buffer to be deleted exists.