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

Request : Rounded left and right separators #46

Closed
paradoxsupreme opened this issue Nov 4, 2020 · 19 comments · Fixed by #386
Closed

Request : Rounded left and right separators #46

paradoxsupreme opened this issue Nov 4, 2020 · 19 comments · Fixed by #386
Assignees
Labels
request New feature or request

Comments

@paradoxsupreme
Copy link

It would be nice if it had support for powerline rounded separators between buffers.

@romgrk
Copy link
Owner

romgrk commented Nov 4, 2020

It's currently using this for icons:

let icons = extend({
\ 'bufferline_default_file': '',
\ 'bufferline_separator_active':   '',
\ 'bufferline_separator_inactive': '',
\ 'bufferline_close_tab': '',
\ 'bufferline_close_tab_modified': '',
\}, get(g:, 'icons', {})) "

However this is undocumented and therefore not supported currently. I haven't decided yet how to expose that but I guess it should rather be on the g:bufferline dict rather than on a separate g:icons dict. But I think it won't work for powerline separator because those one require logic to gather th fg/bg from the item after/before.

@romgrk
Copy link
Owner

romgrk commented Nov 7, 2020

Did you have an example of how you'd want it to look? I've been checking the powerline separators and I don't feel that any of them would have an aesthetically pleasing result. I would maybe add a separator for #22, but for the moment I'm not inclined to add powerline separator in-between tabs. The infrastructure to do it is however in-place as I had to make a refactor for scrollable tabs, so I would accept a PR that doesn't increase complexity by too much.

@hewcaw
Copy link

hewcaw commented Nov 7, 2020

Maybe he meant something like this (notice the statusline).

@paradoxsupreme
Copy link
Author

paradoxsupreme commented Nov 7, 2020

Did you have an example of how you'd want it to look? I've been checking the powerline separators and I don't feel that any of them would have an aesthetically pleasing result. I would maybe add a separator for #22, but for the moment I'm not inclined to add powerline separator in-between tabs. The infrastructure to do it is however in-place as I had to make a refactor for scrollable tabs, so I would accept a PR that doesn't increase complexity by too much.

Maybe he meant something like this (notice the statusline).

Yes that's exactly what I want. The unicode characters for rounded powerline separators are U+E0B6 and U+E0B4. So what I had in mind was to use U+E0B6 at the start of tabline and then to separate tabs with the U+E0B4 separator.

@romgrk
Copy link
Owner

romgrk commented Nov 8, 2020

That screenshot does look nice, but it doesn't match exactly what you're describing. What you describe sounds like this:

Screenshot from 2020-11-08 03-07-00

And I'm still not convinced. I'm open to making things look nice, but I'd need detailed (and nice looking) diagrams. You can build an example with the terminal, eg:

export bg1=243 &&
export fg1=255 &&
echo -e "\x1b[38;5;${bg1}m\ue0b6\x1b[0;48;5;${bg1};38;5;${fg1}mtab 1\x1b[0;38;5;${bg1}m\ue0b4"

(refer to https://github.com/guns/xterm-color-table.vim for colors)

@paradoxsupreme
Copy link
Author

That screenshot does look nice, but it doesn't match exactly what you're describing. What you describe sounds like this:

Screenshot from 2020-11-08 03-07-00

And I'm still not convinced. I'm open to making things look nice, but I'd need detailed (and nice looking) diagrams. You can build an example with the terminal, eg:

export bg1=243 &&
export fg1=255 &&
echo -e "\x1b[38;5;${bg1}m\ue0b6\x1b[0;48;5;${bg1};38;5;${fg1}mtab 1\x1b[0;38;5;${bg1}m\ue0b4"

(refer to https://github.com/guns/xterm-color-table.vim for colors)

The screenshot you posted describes what I had in mind. Maybe you can add the option to customize the highlights of the background of the active and inactive tabs so somebody can tweak it to make it look nicer.

@romgrk
Copy link
Owner

romgrk commented Nov 9, 2020

Sorry I still don't see it being beautiful, so I won't invest time in it :/ If anyone is interested and thinks they can make it look nice, I accept PRs.

@Iron-E
Copy link
Collaborator

Iron-E commented Dec 1, 2020

@paradoxsupreme there's now an API for customizing icons. I suspect it will take some work to set up the highlight groups and icons but it should technically be possible now

See the linked PR above this comment for more info, as well as the :help page which outlines how to change the icons

@paradoxsupreme
Copy link
Author

@paradoxsupreme there's now an API for customizing icons. I suspect it will take some work to set up the highlight groups and icons but it should technically be possible now

See the linked PR above this comment for more info, as well as the :help page which outlines how to change the icons

Nice ! good job man thanks. I will try it out!

@romgrk
Copy link
Owner

romgrk commented Dec 1, 2020

Though I don't think it will be enough to reproduce the screenshot above

@Iron-E
Copy link
Collaborator

Iron-E commented Dec 1, 2020

After trying for some time I think you might be right. The closing icons would need their own highlight group in order to make it look right with respect to the background.

In case anyone is interested, that change would be made in render.lua on line 171. Probably something like:

closePrefix = namePrefix .. 'Close'

Defaults for these groups would also need to be added in autoload/bufferline/highlight.vim

@xtrats
Copy link

xtrats commented Feb 14, 2022

Sorry I still don't see it being beautiful, so I won't invest time in it :/ If anyone is interested and thinks they can make it look nice, I accept PRs.

I think what he wants is like this (ignore the text):

image

@Iron-E Iron-E added the request New feature or request label Jun 6, 2022
@xinslu
Copy link

xinslu commented Jan 22, 2023

Hi, I think this would be possible, if we added an option for different left and right separators, then we can easily pad in the glyphs and make it rounded. I think this would be fairly trivial and would allow for a high degree of customization. I know this issue had been dead for a long time. But if you're accepting PRs for this I would be happy to work on it!

@Iron-E
Copy link
Collaborator

Iron-E commented Jan 22, 2023

@xinslu we'd be glad to have you work on this! You're right, it doesn't seem undoable, there just hasn't been interest in pushing it forward thus far. Feel free to open a PR

@Iron-E
Copy link
Collaborator

Iron-E commented Mar 24, 2023

#386 adds the ability to specify left and right separators:

barbar

(The config in the image: here and here)

You can try it, but there may yet be changes before the final release. If you do, feel free to leave feedback.

Expect to tweak the default hl groups, since rounded/slanted characters have weird interactions compared to how normal characters get highlighted. Just type :hi Buffer and hit your wildchar (see :h 'wildchar' or :lua = string.char(vim.opt.wildchar:get())) to look at the options available.

@Iron-E Iron-E self-assigned this Mar 24, 2023
@oredaze
Copy link

oredaze commented Mar 25, 2023

@Iron-E I was looking to create exactly this look, but was missing option for right separator. It would be very nice if we get this.

@Iron-E
Copy link
Collaborator

Iron-E commented Mar 30, 2023

For those still watching this issue, see :h barbar-setup.icons.separator in the latest master.

@JennytheDragon2000
Copy link

how to remove the highlight of this tab?
image

@Iron-E
Copy link
Collaborator

Iron-E commented Jun 13, 2023

how to remove the highlight of this tab?
image

Are you using the preset feature? Either way, look at the README and try using the information there (we have detailed info on all the highlight groups)

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

Successfully merging a pull request may close this issue.

8 participants