Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using bbye for closing buffers #19

Closed
ChristianChiarulli opened this issue Oct 30, 2020 · 4 comments
Closed

Consider using bbye for closing buffers #19

ChristianChiarulli opened this issue Oct 30, 2020 · 4 comments

Comments

@ChristianChiarulli
Copy link

https://github.com/moll/vim-bbye/blob/master/plugin/bbye.vim

I think it will be more intuitive for people.

For instance when you close a buffer but three are open and then the editor just closes.

@romgrk
Copy link
Owner

romgrk commented Oct 30, 2020

Oh yes I use something similar in my config. Though I never use the close buttons, I just find them aesthetically pleasing. I wonder if it should be included as a dependency or if we should just distribute it directly with barbar.

@mawkler
Copy link
Contributor

mawkler commented Oct 30, 2020

I want to add that when closing buffers using bbye's :Bdelete the buffer tab of the deleted buffer isn't properly removed like for :bdelete. Perhaps a new issue should be created for this.

@romgrk
Copy link
Owner

romgrk commented Oct 30, 2020

I've made a draft fix for :Bdelete issue in #20, though I by using timers it's introducing latency that I can clearly perceive, so I don't think I will be merging that :/ I don't have that issue because my custom function to close buffers triggers a BufEnter autocommand after closing the previous buffer, which isn't the case for bbye.vim. This should probably opened as an issue in bbye, because there are no after-buffer-close autocmd. There are after-win-leave, but because of bbye the win-leave happens before the buf-close.

Reference: https://github.com/romgrk/nvim/blob/master/rc/function.vim#L123-L153

I would however be open to distributing a fixed version of bbye.vim including the trick above. I've been thinking about implementing BufferClose and BufferOpen commands in barbar, among other things to be able to open a buffer after the current one, not at the end of the list.

@romgrk
Copy link
Owner

romgrk commented Oct 30, 2020

Done. I've include bbye. Let me know if there is any issue with that update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants