neovim-gtk icon indicating copy to clipboard operation
neovim-gtk copied to clipboard

Tabline never visible unless a new tab is opened through the new tab icon

Open cyanreg opened this issue 3 years ago • 11 comments

Like the title says, regardless of the Tabline setting, the tabline is never shown, unless a new tab is manually created by clicking on the Open a new tab icon on the window decorations (which I don't even use). This is a regression from the fork at daa84/neovim-gtk, where the tabline is correctly shown on startup.

I should mention I'm using https://github.com/romgrk/barbar.nvim, which kind of blurs the boundary between a tab and a buffer.

cyanreg avatar Oct 31 '21 04:10 cyanreg

Hey guys,

Not sure if you are speaking of neovim's tabline or the external (gtk) one.

I personally like a clean interface and the fact that the gtk tabline only displays if there are more than one tab. It is very similar to how vim-gtk3 used to work. For example:

Screenshot from 2021-11-10 10-36-21

Screenshot from 2021-11-10 10-36-26

So, if there is going to be a change to always display the tab even with only one file open, I would like to kindly ask to make that a preference so that one can choose if they want that or not.

bellini666 avatar Nov 10 '21 13:11 bellini666

I should mention I'm using https://github.com/romgrk/barbar.nvim, which kind of blurs the boundary between a tab and a buffer.

@cyanreg I forgot to ask - does this happen without the plugin enabled? (I am willing to fix it either way JFYI, would just like to know if I need to setup the plugin before getting started)

Lyude avatar Nov 15 '21 01:11 Lyude

Hey guys,

Not sure if you are speaking of neovim's tabline or the external (gtk) one.

@cyanreg this would also be good to know

I personally like a clean interface and the fact that the gtk tabline only displays if there are more than one tab. It is very similar to how vim-gtk3 used to work. … So, if there is going to be a change to always display the tab even with only one file open, I would like to kindly ask to make that a preference so that one can choose if they want that or not.

I've got no plans of changing any defaults

Lyude avatar Nov 15 '21 01:11 Lyude

Happens with or without barbar. I'm talking about the internal tabline, but it really happens with both - neither are visible with the plugins I have. My understanding of the tabline setting is that it disables the external tabline, which is what I'd like.

cyanreg avatar Nov 15 '21 02:11 cyanreg

I forgot to mention this before but:

Like the title says, regardless of the Tabline setting, the tabline is never shown, unless a new tab is manually created by clicking on the Open a new tab icon on the window decorations (which I don't even use).

JFYI, the "Open a new tab" button just calls :tabc

Anyway-sorry, I'm still not entirely sure what the issue you're describing is here. I took a guess based on the description here and tried sticking:

call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)

Into my init.vim, and from my experiments it seemed the non-external tabline would come up by default. If I tried running neovim-gtk like so though:

nvim-gtk --no-fork -- -p /tmp/1 /tmp/2

The external tabline would be used and the internal one would be used. But the behavior was pretty much identical in both me and daa84's versions, so I'm not convinced I'm reproducing what you're doing closely enough. I guess it would be helpful to know how are you actually starting up neovim-gtk, and any tabline related settings in your init.vim.

Additionally though, I have a feeling that whatever situation where you're getting the internal tabline to be shown at the right time in daa84 might just be some lucky result of your vim setup if I'm not able to reproduce it here - but I'm not sure. The problem is the whole Tabline option just seems to be broken enough that I wouldn't expect it to work consistently for anyone, as the code for it in redraw_handler in both me and daa84's versions don't appear to take care to actually update the state of the GTK tabline widgets. The only thing it does is update the ext_tabline option in nvim GTK itself, which does at least tell nvim to start/stop sending tabline events.

I have a feeling if I add the appropriate code for updating the visibility of the tabline widget, then this issue might go away. Additionally though, is showtabline involved here at all - seeing as you mentioned needing to open a new tab? I'd definitely need to add some additional code for reading showtabline on startup to nvim-gtk so we can modify the default visibility behavior of the GUI tabline.

Lyude avatar Nov 16 '21 01:11 Lyude

@cyanreg could you try this commit and verify that it fixes your issue?

Lyude avatar Nov 18 '21 01:11 Lyude

Tested, didn't change anything. Regardless of the tabline setting, I'm getting neither a GTK tabline, or the native tabline.

cyanreg avatar Nov 18 '21 03:11 cyanreg

Tested, didn't change anything. Regardless of the tabline setting, I'm getting neither a GTK tabline, or the native tabline.

Just to be clear we're talking about showtabline, right?

Lyude avatar Nov 18 '21 03:11 Lyude

No, about call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)? I'm not seeing showtabline anywhere.

cyanreg avatar Nov 18 '21 05:11 cyanreg

I'm not able to replicate this, my native tabline (the light blue bar below) shows up immediately when opening a new window.

image

jacobmischka avatar Dec 14 '21 22:12 jacobmischka

Are you sure this isn't a duplicate of #13? I've gotten so used to resizing on start to fix that that I didn't notice that the tabline sometimes doesn't show up until afterward.

jacobmischka avatar Jan 23 '22 10:01 jacobmischka