famiu / bufdelete.nvim

Delete Neovim buffers without losing window layout
GNU General Public License v3.0
515 stars 16 forks source link

Handle buffers not attached to windows #14

Closed showermat closed 2 years ago

showermat commented 2 years ago

The commands provided by this plugin are not drop-in replacements for the built-in commands, because they cannot close buffers that are not attached to a window. This is due to if #windows == 0 then return end in the middle of buf_kill. This is inconvenient, because now, when I want to programmatically close a buffer, I have to first check whether it's attached to any windows and then call :bdelete or :Bdelete appropriately. Is there a reason for this restriction? It looks like the code will work fine without it, and it would make this plugin more general-purpose.

famiu commented 2 years ago

I plan to add this feature (and hopefully a few others) soon

showermat commented 2 years ago

Great, looking forward to it!