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

Add the ability to configure a default name for unnamed bufs #12

Closed alaaibrahim closed 8 years ago

alaaibrahim commented 8 years ago

Currently, opening an unnamed buffer would display ('*'), as the title, so adding the ability for the user to override that value (e.g. name it 'No Name').

ap commented 8 years ago

Thank you for the patch. I appreciate that you took the time to update the docs. The patch doesn’t handle the g:buftabline_numbers case though… so I can’t take it as it is. That case is not as trivial to patch as the unnumbered case, because that design really only works well if unnamed files are shown as “*”. Which is why I did not make this configurable in the first place – I’m picky with visual design, it wasn’t easy to make this completely configurable, this layout looked best to me, so I just hardcoded it.

However, it seems a popular enough desire to be able to change this. I’ve seen such changes in other forks that didn’t submit PRs. So I’ll take some time to come up with designs to cover all the bases.

Sorry I’m not taking your patch as it is; I hope that you’re not too disappointed, and that getting the feature anyway will make up for it.

alaaibrahim commented 8 years ago

@ap thanks for the review, I modified the code to cover the buftabline_numbers case. If that doesn't work for you, feel free to just ignore it.

It's your repo, so you can be as picky as much as you want :smile:. Also, I guess it goes without saying, but thanks for the plugin.

ap commented 8 years ago

Sorry I haven’t gotten around to this yet. It’s still going to happen.

alaaibrahim commented 8 years ago

Sorry, I closed it because I made another change (to make the plugin work on vim 7.2), feel free to incorprate that commit if you think it's something that you want, I know most people don't care about supporting older versions of vim. https://github.com/alaaibrahim/vim-buftabline/commit/2b1d919e646e50168348204e2df637b9466ce8d3

ap commented 8 years ago

I do care. Unfortunately it’s not as easy as that patch… that function will give the wrong answer for e.g. fullwidth.txt – which is relevant for filenames in various Asian scripts. OTOH I guess it’s not a big enough concern to warrant it not running on these versions at all… even strwidth is wrong in the face of control characters (as is strdisplaywidth) after all.

alaaibrahim commented 8 years ago

@ap I made another implementation for the strwidth which should cover all these cases https://github.com/ap/vim-buftabline/pull/14.

This will not fix strwidth, it will only mimic it's return value

ap commented 7 years ago

As of a1f6c24aed2dfe2e3db5122de858b83a1eab987f the plugin will work about as well as one can hope for on Vims older than 7.3, all the way back to 7.0.

That just leaves the configurable label for unnamed buffers.