moll / vim-bbye

Delete buffers and close files in Vim without closing your windows or messing up your layout. Like Bclose.vim, but rewritten and well maintained.
http://www.vim.org/scripts/script.php?script_id=4664
Other
648 stars 32 forks source link

Fix issue #5 #7

Closed QMonkey closed 7 years ago

QMonkey commented 8 years ago

Unlisted buffers can be found by 'bufexists' function. However, 'bdelete' command cannot delete the unlisted buffer. That is why the error occurs.

QMonkey commented 8 years ago

Another solution is, using 'buflisted' rather than 'bufexists' function to check whether the buffer is exists or not. I perfer to say goodbye to unlisted buffers, so I make this pull request.

moll commented 8 years ago

Hey! First of all, thanks!

I wish I had written tests for Bbye.vim off the bat so I'd remember whether the choice to use bdelete was intentional. I wonder if it was because bwipeout made it impossible to use Ctrl-o to jump back after deleting a buffer... Do you know?

QMonkey commented 8 years ago

Yes, you are right. It is impossible to use ctrl-o to jump back after deleting a buffer by 'bwipeout'.

QMonkey commented 8 years ago

I make it be able to use ctrl-o to jump back after deleting a buffer. Just replace 'bufexists' with 'buflisted'. In my opinion, 'bdelee' should always correspond to 'buflisted'.

moll commented 7 years ago

Hey, why'd you close this?