ap / vim-buftabline

Forget Vim tabs – now you can have buffer tabs
http://www.vim.org/scripts/script.php?script_id=5057
MIT License
782 stars 75 forks source link

Feature/mouse support nvim #77

Closed anihm136 closed 3 years ago

anihm136 commented 3 years ago

Adds mouse support to nvim - able to click on buffer labels to switch buffers. Not extensively tested, seems to be working for common usecases

ap commented 3 years ago

Thanks for the PR.


The most obvious omission is that this has no provisions to keep working the same on Vim or older NeoVim.

The function name should be script-local, not global, so it needs some fiddling to go in there with a <SID>.

The :execute command takes a list of expressions runs them joined with spaces, so you don’t need to include the space and then use a concatenation operator.

It’s not necessary to put %X after every single tab label since there is no unclickable dead area between tabs.


To make this short I’ve squashed your commits, made all the changes the way I’d like them, and amended the result, and have pushed it to a branch as de099655114f636bbffcc9ad24b9933d7d591854. If you have no objections to that, it can go straight into master.

anihm136 commented 3 years ago

I'm fine with all the changes. I did try fidling with <SID>, but I didn't do it right so that's my takeaway from this. Same goes for the %X part as well. Thanks!

ap commented 3 years ago

The whole <SID> mechanism in Vim is kinda janky… but what can you do.

Anyway – it’s in master now. Thanks for doing the legwork on this. Share and enjoy 🙂