romgrk / barbar.nvim

The neovim tabline plugin.
2.23k stars 83 forks source link

Changing colorschemes breaks icon highlights #382

Closed JasZhe closed 1 year ago

JasZhe commented 1 year ago

Description Similar to https://github.com/romgrk/barbar.nvim/issues/83 except syntax enable is fine now, it's only related to changing colorschemes.

Changing colorscheme after the initial vim setup would break the icon highlights. I'm still new to neovim so I've been working on adding plugins and stuff. I noticed this issue after doing :source init.vim after changing something. The colorscheme being set in init.vim is fine.

To Reproduce

init.vim:

" Vim-plug Plugins
call plug#begin('~/.vim/plugged')
Plug 'nvim-tree/nvim-web-devicons'
Plug 'romgrk/barbar.nvim'

Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
Plug 'navarasu/onedark.nvim'

call plug#end()

colorscheme tokyonight

let bufferline = get(g:, 'bufferline', {}) " create bufferline option dict
let bufferline.icon_pinned = '車'
let bufferline.icons = 'both'
let bufferline.highlight_inactive_file_icons = v:true

Steps to reproduce the behavior:

  1. launch neovim with barbar and some colorscheme installed
  2. run :colorscheme tokyonight onedark also has the same issue so I'm guessing it has to do with highlight clear in colorschemes

Actual: icon highlights for files disappears

Expected: Icon highlights remain

Screenshots image image

Informations Neovim version: v0.8.3

Iron-E commented 1 year ago

I'll have to try tokyonight specifically. I just tried with default and darkblue, doing:

colorscheme default
highlight clear
colorscheme darkblue

The icons came back for me. I'll try with tokyonight though

JasZhe commented 1 year ago

Not sure if this'll help pinpoint the issue, but I'm using iTerm2. Also it seems like it's solely the filetype icon color that disappears, the file modified icon still has color, for instance. image

Iron-E commented 1 year ago

I managed to reproduce with these steps:

  1. Run from the shell:
    nvim --clean 
       --cmd 'set rtp+=~/.local/share/nvim/lazy/tokyonight.nvim' # or your tokyonight path
       --cmd 'colorscheme tokyonight' 
       --cmd 'set rtp+=~/.local/share/nvim/lazy/nvim-web-devicons' # or your nvim-web-devicons path
       -c 'set rtp+=~/.local/share/nvim/lazy/barbar.nvim' # or your barbar path
       a.txt foo.html b.c
  2. Run inside vim:
    lua require'bufferline'.setup()
    colorscheme default

Et voilà! The icon colors are gone. Repro with any colorscheme, not just tokyonight. E.g. default and darkblue also fail here

Iron-E commented 1 year ago

Can you confirm #388 fixes this?

JasZhe commented 1 year ago

yup no longer seeing the issue with the fix in https://github.com/romgrk/barbar.nvim/pull/388 thanks!