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

buftabline and goyo don't work together #64

Open
AxelBohm opened this issue Dec 13, 2018 · 5 comments
Open

buftabline and goyo don't work together #64

AxelBohm opened this issue Dec 13, 2018 · 5 comments
Labels

Comments

@AxelBohm
Copy link

Weird things keep appearing in the tab line when goyo is activated.
See the following issue on the goyo repo:
junegunn/goyo.vim#171 (comment)

@ap ap added the bug label Mar 24, 2019
@ap
Copy link
Owner

ap commented Mar 24, 2019

Somehow this issue completely escaped my attention. Sorry about that. I’m looking into #67 right now.

@ap
Copy link
Owner

ap commented Mar 27, 2019

Well… this is quite a mess, really.

The problem is a Buftabline feature that’s necessary because Buftabline doesn’t support Vim tabs at all. What it does is Buftabline allows the standard Vim tab feature to take over when the user or another plugin has created a Vim tab. Otherwise you wouldn’t see what’s going on.

This collides with Goyo because Goyo works by creating a new Vim tab that it wants to hide. This is… not a use case I had foreseen. It makes complete sense given Goyo’s aim, of course, but it breaks my underlying assumption in Buftabline that the user needs to be able to see what’s going on when a Vim tab is created.

Not sure yet how I’m going to address this…

@vigilancer
Copy link

For history: I've made a PR few days ago (#67) that was addressing this issue.
Unfortunately that patch works for me only and is not good enough to go mainstream.
Moving conversation from PR to this issue.

How about (arguably dirty) check if exists('#goyo') before check for number of tabs?

@vigilancer
Copy link

vigilancer commented Mar 27, 2019

like this:
vigilancer@2058d75

I didn't find in :h goyo any knobs that could affect showtabline so IMO it is safe to assume that when Goyo is enabled it wants to hide tabline.

Note that one still have to manually call buftabline#update on GoyoEnter and GoyoLeave events:

autocmd! User GoyoEnter nested call <SID>GoyoEnter()
autocmd! User GoyoLeave nested call <SID>GoyoLeave()

function! s:GoyoEnter() "
    :call buftabline#update(0)
endfunction "

function! s:GoyoLeave() "
    :call buftabline#update(0)
endfunction "

@ap
Copy link
Owner

ap commented Mar 27, 2019

Arguably dirty. 🙂

Right now I’m thinking of adding another setting in Buftabline to disable the Vim tabs fallback. In the future when Buftabline supports tab pages, the same setting could be expanded to allow the user to control whether tab pages should trigger Buftabline’s internal support, the fallback to Vim tabs, or nothing. And once this setting exists, Goyo could use it to override Buftabline’s handling of tabs while Goyo is active, much as it already does for several other plugins.

Logically I don’t see a problem with that, but I can’t yet say whether it feels right, so I wanna sleep on it for a bit. Adding a setting is a long-term commitment.

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

No branches or pull requests

3 participants