tiagovla / scope.nvim

Revolutionize Your Neovim Tab Workflow: Introducing Enhanced Tab Scoping!
406 stars 21 forks source link

bug: `bdelete` is deleting a tab instead a single buffer #22

Closed fzhnf closed 10 months ago

fzhnf commented 10 months ago

after following the bufferline.nvim documentation on how to see only buffers per tab, before installing the scope.nvim plugin i attempted to delete buffers using :bdelete and it work just fine, it delete single buffer. However, after installing it (just by add the line 'tiagovla/scope.nvim'), the command delete a tab instead, even without creating multiple tab using :tabnew it still delete the whole buffer per tab,

i'm not sure what is the issue, my config

tiagovla commented 10 months ago

Could you use a minimal config with the plugin installed and give instructions to reproduce it?

fzhnf commented 10 months ago

Thank you for your reply!

After trying Neovim with lesser and lesser config, until without a config, it appears that my issue was related to Neovim's behavior of closing the tab when using :bdelete on the focused buffer with only one pane. If there are more than two panes (either using :split or :vsplit), it will not close the tab because it will change focus to the available buffer pane. Therefore, it was not a bug but rather expected behavior.

my confusion seems because bufferline.nvim, which i expect to always display all buffers.

as example, when i try to close a buffer, the tab disappears (Neovim behavior), but due to using scope.nvim separating buffers per tab so the remaining tab's buffers are hidden from bufferline.nvim. At first i thought that the entire buffer inside that tab was gone, but using the command :ball it was still present.

To fix this, my approach to closing the buffer without closing the tab is to use :bprevious and then :bdelete #. This changes the focused buffer to previous one, close the buffer i intended to close, and importantly, the tab remains. I will make a mapping for this.

Once again, thank you for your reply! I wouldn't have noticed my own mistake.

tiagovla commented 10 months ago

Cool! I use this https://github.com/famiu/bufdelete.nvim, BTW.