vim-airline icon indicating copy to clipboard operation
vim-airline copied to clipboard

Modified statusline section_y disappears

Open ThatsNoMoon opened this issue 4 years ago • 2 comments

environment

  • vim: 8.2
  • vim-airline: v0.11-352-gc01977d
  • OS: Arch Linux on WSL
  • Have you reproduced with a minimal vimrc: yes (also below)
  • What is your airline configuration: let g:airline_section_y = 'W %{winnr()}' if you are using terminal:
  • terminal: alacritty
  • $TERM variable: xterm-256color
  • color configuration (:set t_Co?): N/A (?) if you are using Neovim:
  • does it happen in Vim: yes

expected behavior

W n appears in the statusline, where n is the window number.

actual behavior

W n initially appears but disappears seemingly randomly. The easiest reproduction is to open vim with this vimrc:

set nocompatible
filetype off
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin('~/.config/nvim/bundle')
Plugin 'VundleVim/Vundle.vim'

Plugin 'vim-airline/vim-airline'

call vundle#end()
filetype plugin on

let g:airline_section_y = 'W %{winnr()}'

and use c-w v to make a vertical split. Both windows will no longer have a W n indicator.

Another way to reproduce is to use :help; the Help window will not have W n in its statusline, but the original window will. If you use c-w L to make that Help window into a vertical split and use c-w h to switch back to the original window, its W n indicator will disappear as well.

screenshot

In this screenshot, the top Help window is missing its window number in the statusline, while the bottom blank window's number is correctly displayed. Screenshot 2021-02-12 134209 In this screenshot, neither window's statusline is correctly displaying the window's number. Screenshot 2021-02-12 134038

ThatsNoMoon avatar Feb 12 '21 20:02 ThatsNoMoon

I tried the minimum configuration you suggested, but it did not reproduce this problem.

Perhaps the size of the terminal emulator is too small. Please try again with the maximum size. If the terminal emulator is small, vim-airline will truncate sections in order to reduce the amount of information.

get-me-power avatar Feb 14 '21 13:02 get-me-power

Okay, I think some other behaviors I would not expect from airline are causing this. My laptop itself is apparently not large enough to fit two windows with airline on them horizontally, despite there clearly being more than enough room to fit my 3 extra characters. In addition, resizing windows does not refresh airline, but changing windows does. This means that there are situations where the window is definitely large enough to fit my tiny addition to section_y but airline doesn't think so, and situations where airline does not even realize how big the window is. I think airline is also under the impression that section_y should not be displayed for a Help window, which makes this harder to use.

If there is a way to get airline to treat my section_y like the built-in section_z which does not disappear when my windows get smaller, I'll be happy enough, though these other behaviors are also not ideal in my opinion.

ThatsNoMoon avatar Feb 14 '21 22:02 ThatsNoMoon

should be fixed by #2575

chrisbra avatar Sep 21 '22 07:09 chrisbra