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

Devicons - airline interface could be less than ideal... tabline shows devicons for conditional package loading, statusline does not #378

Open
9 tasks done
poetaman opened this issue Feb 3, 2021 · 1 comment

Comments

@poetaman
Copy link

poetaman commented Feb 3, 2021

Required Info

  • I have searched the issues for my issue and found nothing related and/or helpful
  • I have read or at least glanced at the FAQ
  • I have read or at least glanced at the Wiki
  • VimDevIcons is the last loaded vim plugin?
  • What version of vim are you using?
    • 8.2
  • What version of vim-devicons are you using?
    • 0.11.0
  • Are you using vim from the terminal or a GUI vim?
  • Are you using Mac, Linux or Windows?

Optional Info

  • Provide screenshots where appropriate

Note This issue has been filed on vim-airline here, and on vim-plug here. This issue is filed here too as it could be in interface of devicons and vim-airline, or with the conditional plug loading scheme offered by vim-plug.

actual behavior

Devicons do not render in statusline, they render correctly in tabline for conditional plugin load feature of vim-plug. In case of vim running in terminal, reducing the size of terminal (to hide/fold the place where icons are to be rendered) and then expanding makes the icons appear in status line.

expected behavior

Given icons are rendering correctly in tabline, status line's code should be based on its model (sequence of events I guess) so they both render correctly.

Detailed example (also filed on vim-plug, just in case its a plugin load problem, we don't know yet):

Here's a very small test .vimrc in two flavors: 1) no conditional plugin load (.myvimrc1), 2) all plugs loaded conditionally on same trigger condition (.myvimrc2). We open two instances of vim, one each for the corresponding vimrc. One would expect the behavior of both vim instances to be same after triggering event happens in vim instance loaded with .myvimrc2. As can be seen below, the only difference between them its that devicons are not loaded in statusline of .myvimrc2, though they are loaded in tabline. For .myvimrc1's vim session, both statusline & tabline display devicons correctly. On further testing, I found that if reduce the size of the window to hide the region of statusline where devicons should have rendered, and enlarge the screen again... the icons appear. While this is definitely a bug for the interface between airline, and devicons, it is also a inquiry for vim-plug, and if there is a way to overcome this. I would appreciate an conditional load answer that works.

Screenshot for >> vim -u .myvimrc1 .myvimrc1:
Screen Shot 2021-02-03 at 6 51 21 AM

Screenshot for >> vim -u .myvimrc2 .myvimrc2 && :Mycmd<CR>
Screen Shot 2021-02-03 at 6 01 34 AM

Gif showing the behavior of .myvimrc2:
airlinedevicon_compressed

source (.myvimrc2), command vim -u .myvimrc2 .myvimrc2

set nocompatible
set fileencoding=utf-8

function! Myfunc()
  call plug#load(keys(g:plugs))
endfunction


command Mycmd execute 'normal! :call Myfunc()<CR>'

call plug#begin('~/.vim/plugged')
  Plug 'vim-airline/vim-airline', {'on':'Mycmd'}
  Plug 'vim-airline/vim-airline-themes', {'on':'Mycmd'}
  Plug 'ryanoasis/vim-devicons', {'on':'Mycmd'}
call plug#end()

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1

source (.myvimrc1), command vim -u .myvimrc1 .myvimrc1

set nocompatible
set fileencoding=utf-8

function! Myfunc()
  call plug#load(keys(g:plugs))
endfunction

command Mycmd execute 'call Myfunc()'

call plug#begin('~/.vim/plugged')
  Plug 'vim-airline/vim-airline'
  Plug 'vim-airline/vim-airline-themes'
  Plug 'ryanoasis/vim-devicons'
call plug#end()

if !exists('g:airline_symbols')
  let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 28 2020 07:15:57)
macOS version
Included patches: 1-2164
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               -ebcdic            +localmap          +printer           +timers
+arabic            +emacs_tags        +lua               +profile           +title
+autocmd           +eval              +menu              -python            +toolbar
+autochdir         +ex_extra          +mksession         +python3           +transparency
-autoservername    +extra_search      +modify_fname      +quickfix          +user_commands
+balloon_eval      -farsi             +mouse             +reltime           +vartabs
+balloon_eval_term +file_in_path      +mouseshape        +rightleft         +vertsplit
+browse            +find_in_path      +mouse_dec         +ruby              +virtualedit
++builtin_terms    +float             -mouse_gpm         +scrollbind        +visual
+byte_offset       +folding           -mouse_jsbterm     +signs             +visualextra
+channel           -footer            +mouse_netterm     +smartindent       +viminfo
+cindent           +fork()            +mouse_sgr         -sound             +vreplace
+clientserver      +fullscreen        -mouse_sysmouse    +spell             +wildignore
+clipboard         +gettext           +mouse_urxvt       +startuptime       +wildmenu
+cmdline_compl     -hangul_input      +mouse_xterm       +statusline        +windows
+cmdline_hist      +iconv             +multi_byte        -sun_workshop      +writebackup
+cmdline_info      +insert_expand     +multi_lang        +syntax            -X11
+comments          +ipv6              -mzscheme          +tag_binary        -xfontset

@get-me-power
Copy link
Collaborator

get-me-power commented Jul 16, 2021

Thanks for your report.

Why do you need to lazy load vim-airline and vim-devicons in the first place?
Lazy loading is a hack, and sometimes breaks the behavior of plugins.
It's possible that these plugins are not designed for such use cases.

Please also see this issue.
I completely agree with this opinion.

vim-airline/vim-airline#2327

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

2 participants