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

Suggestion: Tab indicator showing current Vim tab #22

Closed
mawkler opened this issue Oct 30, 2020 · 6 comments
Closed

Suggestion: Tab indicator showing current Vim tab #22

mawkler opened this issue Oct 30, 2020 · 6 comments

Comments

@mawkler
Copy link
Collaborator

mawkler commented Oct 30, 2020

I switched to this plugin from vim-airline's buffer tabs because this looks so much sexier. However, something I miss from airline's buffer tabs is the little indicator in the topright corner which shows up when you have multiple vim tabs open, indicating with a number which is the current one, for instance "tab 1/2" as shown in my screenshot. I would love if this were added to this plugin.

vim tabs

@romgrk
Copy link
Owner

romgrk commented Oct 31, 2020

That would be nice and isn't that hard to implement. By the way I've done this, I'm looking for comments. I'm not sure if it's a good idea or not.

@Iron-E
Copy link
Collaborator

Iron-E commented Nov 13, 2020

It seems like there's an oddity with the feature. When I close a tab and open a new one, the count of tabs I currently have stays the same is correct, but the tab it says I'm currently on keeps increasing:

Oddity

The bar's background color also changes, from when there are only buffers (and no tabs open):

Original color

Is that intended?

@mawkler
Copy link
Collaborator Author

mawkler commented Nov 13, 2020

Yeah I noticed the ever increasing tab number too.

This looks like a problem with the builtin function nvim_get_current_tabpage() because doing :echo nvim_get_current_tabpage() after opening and then closing a bunch of tabs reveals that the number always increases. However, using tabpagenr() seems to yield the expected result.

@Iron-E
Copy link
Collaborator

Iron-E commented Nov 14, 2020

That's interesting! Thanks for finding it.

I created a pull to fix it, although the issue of the bar inverting its colorscheme still happens.


We should think about making an issue on neovim/neovim about that too.

@romgrk
Copy link
Owner

romgrk commented Nov 14, 2020

Could you print echom &tabline when you see the inversion issue and show me the content of it? Also if you could show me the content of hi BufferTabpages or any other hl group that appears near the end of the tabline?

You can open a separate issue for that. I wouldn't think it would be in neovim.

@Iron-E
Copy link
Collaborator

Iron-E commented Nov 14, 2020

I meant open an issue for nvim_get_current_tabpage(), since it seems to be printing out the current tab as if no tabs have been closed.


Here's echom &tabline:

#BufferInactiveSign#▎    %#BufferInactive# %#BufferInactive#[buffer 1]     %#BufferInactive# %#BufferCurrentSign#▎    %#DevIconDefault# %#BufferCurrent#[
buffer 3]     %#BufferCurrent# %0@BufferlineMainClickHandler@%#BufferInactiveSign#▎%=%#BufferTabpages# 2/2 %#TabLineFill#

And here's hi BufferTabpages:

BufferTabpages xxx gui=bold guifg=#d5508f guibg=#505050

When I link BufferTabpages, the far right is changed:

Right

Go back to HEAD~7 and the color inverting doesn't happen in between.

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