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

Customizations added via airline#add_statusline_func() are not respected in terminal windows #2249

Open
nikvdp opened this issue Oct 8, 2020 · 3 comments

Comments

@nikvdp
Copy link

nikvdp commented Oct 8, 2020

environment

  • vim: NVIM v0.4.3
  • vim-airline: commit aa773f5cdfeba1ecb8ae5b55d9ab5fc817f0951d
  • OS: mac
  • Have you reproduced with a minimal vimrc: yes
  • What is your airline configuration: default
    if you are using terminal:
  • terminal: kitty
  • $TERM variable: xterm-256color
  • color configuration (:set t_Co?):
    if you are using Neovim:
  • does it happen in Vim: yes

actual behavior

After using call airline#add_statusline_func() customizations appear on the new terminal window, but disappear if you <C-w> out of the window.

As a workaround I am disabling airline's own term extension (via g:airline#extension#term#enabled = 0) in my vimrc. It works as expected with airline's term extension disabled.

Here is the statusline func I was using to test. You can drop it in init.vim to reproduce.

function! MyPluginThing(...)
  return "!!! I AM CUSTOM !!!"
endfunction

function! MyPlugin(...)
    let w:airline_section_a = 'MyPlugin3'
    let w:airline_section_b = '%f'
    let w:airline_section_c = '%{MyPluginThing()}'
    let g:airline_variable_referenced_in_statusline = 'foo'
endfunction
call airline#add_statusline_func('MyPlugin')

expected behavior

Terminal windows honor the airline#add_statusline_func() at all times.

screen shot (if possible)

Note that the !!! I AM CUSTOM !!! string is originally present in the terminal window, but after I move in and out of the window it disappears.

render1602122285572

@chrisbra
Copy link
Member

I think you need to use airline#add_inactive_statusline_func to have it apply for in-active statuslines as well.

@nikvdp
Copy link
Author

nikvdp commented Oct 14, 2020

I’ll give that a try, but I believe this is still a bug since it stays gone even when you switch back to the original window

@bzub
Copy link

bzub commented Nov 26, 2020

I see this also with default statusline functions. Section B for example shows git information in Terminal mode but then loses that information switching between windows.

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