bufferline.nvim icon indicating copy to clipboard operation
bufferline.nvim copied to clipboard

Add relative buffer number for currently visible buffer

Open rameshsanth opened this issue 2 years ago • 3 comments

Here is a possible fix for #249 , #291 . This is more like a proof of concept of how this can be achieved.

The fix involves add bufferline index to the buffer name as .<buflineIndex>. In the screenshots below, you can see the filenames start with <X>.1 onwards

It works in my setup with my configuration. However I'm not sure how this would work with various options that bufferline provides.

I welcome comments.

Screenshot 2023-07-30 at 7 33 49 PM

Upon selecting BufferLineGoToBuffer 1 Screenshot 2023-07-30 at 7 35 34 PM

rameshsanth avatar Jul 31 '23 02:07 rameshsanth

@rameshsanth @akinsho any prevision for when it will be merged? The ordinal here don't have the correct order.

image

would be awesome to always keep the order (helps on navigation)

otavioschwanck avatar Nov 29 '23 13:11 otavioschwanck

This one was raised more as a proof of concept and not definitive IMO. I haven't had much time to dig into these sorts of things in the last few weeks. I'm really focusing on my side projects, not on open source stuff at the moment. More than any other feature, the numbers feature creates a lot of work for me and frankly I'm fairly convinced I should deprecate it given how many issues I get about numbers.

Looking at it I don't think this is an easy merge. It seems like something to discuss because this will definitely mess up some other people's flow and I'm not entirely sure about what the problem clearly is. I know that they're out of order but I'm not sure what people in general want out of the numbers because it never seems to be enough or right enough for everyone

akinsho avatar Nov 29 '23 13:11 akinsho

This one was raised more as a proof of concept and not definitive IMO. I haven't had much time to dig into these sorts of things in the last few weeks. I'm really focusing on my side projects, not on open source stuff at the moment. More than any other feature, the numbers feature creates a lot of work for me and frankly I'm fairly convinced I should deprecate it given how many issues I get about numbers.

Looking at it I don't think this is an easy merge. It seems like something to discuss because this will definitely mess up some other people's flow and I'm not entirely sure about what the problem clearly is. I know that they're out of order but I'm not sure what people in general want out of the numbers because it never seems to be enough or right enough for everyone

understood!

The real goal with the ordered numbers (by visible path) is to look to the tab and see the number, then just call something like (in my case, SPC 1-9) and quick go to the buffer. It works awesome with pins (i can have my 4 or 5 pins and easily memorize their numbers, with this, i just press SPC 1, SPC 2, SPC 3 (that is mapped to BufferLineGoToBuffer 1,2,3) and quickly go to the file. If i forgot some file number, i just go and look the bar to remember).

otavioschwanck avatar Nov 29 '23 16:11 otavioschwanck

I get pinged with every update of this PR so I'm going to close it as is as I don't think it's in a mergeable state. I'm open to the idea but not this implementation. It really muddies the waters by directly hardcoding highlight colour names in an area where those kind of specifics shouldn't be. If you or anyone else is willing to try another PR then please have at it but ideally maintain the separation of concerns and avoid overly imperative logic 🙏🏾 sorry but fleshing out how to approach it would be a non zero amount of work and will have to be part of the job of the implementor figuring this out

akinsho avatar Feb 07 '24 11:02 akinsho