itchyny/lightline.vim

Lightline themes doesn't work with Neovim 0.10.1 and newer versions

Opened this issue · 14 comments

Hund commented

This is what my Lightline with the Solarized theme looks like know. They changed things with the colours or something, which broke pretty much every colour scheme out there. Lightline seems to be affected as well.

2024-09-17-112334_1920x1080_scrot

Is there any way to fix this?

Could you identify which change in neovim causes the regression?

Hund commented

Could you identify which change in neovim causes the regression?

Checking :h news shows me this:

  • Default color scheme has been updated to be "Nvim branded" and accessible.
    Use `:colorscheme vim` to revert to the old legacy color scheme.
    • These Nvim specific highlight groups are now defined in a meaningfully
      different way and might need an update:
      • |hl-FloatBorder| is linked to |hl-NormalFloat| instead of |hl-WinSeparator|.
      • |hl-NormalFloat| is not linked to |hl-Pmenu|.
      • |hl-WinBar| has different background.
      • |hl-WinBarNC| is similar to |hl-WinBar| but not bold.
      • |hl-WinSeparator| is linked to |hl-Normal| instead of |hl-VertSplit|.
    • This also might result into some color schemes looking differently due
      to them relying on implicit assumptions about how highlight groups are
      defined by default. To account for this, define all attributes of
      highlight groups explicitly. Alternatively, use `:colorscheme vim` or
      `:source $VIMRUNTIME/colors/vim.lua` to restore previous definitions.

There's been a few complaints about this as well, like this one: neovim/neovim#29013

What's the result of :echo [get(g:, 'solarized_termcolors', -1), &t_Co]? Both with Neovim 0.10.1 and with the Neovim version worked before.

Screenshot 2024-09-18 at 15 13 50

I cannot reproduce the issue yet, so please describe the reproducing steps as in detail as possible.
Here's the init.lua I used when I took screenshot above.

vim.o.runtimepath = '/path/to/lightline,' .. vim.o.runtimepath
vim.g.lightline = {
  colorscheme = 'solarized',
}

vim.o.laststatus = 3
Hund commented

What's the result of :echo [get(g:, 'solarized_termcolors', -1), &t_Co]? Both with Neovim 0.10.1 and with the Neovim version worked before.

I get the same message with version 0.9.5 and 0.10.1: [-1, '256']

Screenshot 2024-09-18 at 15 13 50

I cannot reproduce the issue yet, so please describe the reproducing steps as in detail as possible. Here's the init.lua I used when I took screenshot above.

vim.o.runtimepath = '/path/to/lightline,' .. vim.o.runtimepath
vim.g.lightline = {
  colorscheme = 'solarized',
}

vim.o.laststatus = 3
  1. I upgraded to the newer version of Neovim 0.10.1.
  2. Themes and Lightline are broken.
  3. Replacing old theme vim-colors-solarized with newer NeoVim theme neosolarized.nvim.

If I want to get everything to 'work', I have to downgrade to version 0.9.5 and go back to the old theme with the old syntax of how themes now work.

My wild guess would be that the Solarized theme for Lightline relies on the old way how themes work in version 0.9.5 and earlier versions. :)

Please share your Neovim configuration file to reproduce the issue, and the screenshot how it looks with 0.9.5.

Hund commented

Please share your Neovim configuration file to reproduce the issue, and the screenshot how it looks with 0.9.5.

I can give you the relevant parts of my config:

call plug#begin('~/.config/nvim/plugged')
Plug 'overcache/NeoSolarized'
Plug 'itchyny/lightline.vim'
call plug#end()

let g:lightline = { 'colorscheme': 'solarized', }
set laststatus=2

colorscheme NeoSolarized
set background=dark

I included a screenshot in the first post. :)

What do you mean by broken?

Hund commented

They changed how things work with themes, which broke old themes. They simply doesn't work anymore. I could solve it by using a new theme explicitly written for newer version of Neovim (not Vim). This seems to have broken Lightline as well, as it seems to be relying on how themes worked in the past.

Sorry but I can't still understand what you're talking. What do you mean by old/new themes? The colors of lightline is not related to the pre-defined highlight groups. For me, Neovim 0.10.0 working well with lightline colors perfectly. You still don't describe how you expect to see; the screenshot in the first post looks lightline working.

Hund commented

The affected version is 0.10.1. Not 0.10.0. See my previous reply with the :h news part.

The first image in the first shows me when I have the theme Solarized. I'm sorry if that wasn't clear. It's broken in the sense that it uses some other colours than the Solarized ones.

Do you think it works or not in the screenshot in #682 (comment)?

Also, what's the result of :hi LightlineMiddle_command and :hi LightlineLeft_normal_0 ?

Hund commented

This is weird. I'm currently in Linux Mint. I just updated to version v0.11.0-dev-783+g0ade8fed1, and everything works, with the same config from Gentoo Linux, which is what I normally use. I'll try to update version in Gentoo to see if that fixes it.

Do you think it works or not in the screenshot in #682 (comment)?

Yes. Here's a screenshot of Neovim 0.10.0 in Linux Mint. Here's everything working just fine.

Screenshot from 2024-09-18 17-13-26

Also, what's the result of :hi LightlineMiddle_command and :hi LightlineLeft_normal_0 ?

I'll check when I'm back in Gentoo again.