nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
6.25k stars 468 forks source link

Bug: Highlights are incorrectly rendered when StatusLine highlight group is inverted #1312

Open Ontonator opened 1 month ago

Ontonator commented 1 month ago

Self Checks

How to reproduce the problem

  1. Use a version of Neovim ≥ commit e049c6e4c08a141c94218672e770f86f91c27a11
  2. Use a colorscheme in which StatusLine has reverse set

Expected behaviour

Colours look normal.

Actual behaviour

Colours are inverted (including double inverting of highlight groups that are already inverted). Section separators are incorrect, since they use the background colours (which are now the foreground colours) of the adjacent components and they are on the wrong side (since their own background and foreground colours are swapped).

Minimal config to reproduce the issue

call plug#begin("[redacted]/config/.local/share/nvim/plugged")
" Your plugins go here like
Plug 'nvim-lualine/lualine.nvim'

call plug#end()

" Your Viml part of config goes here
" colorscheme onedark
hi StatusLine gui=reverse

lua << END
-- Your lua part of config goes here
require'lualine'.setup {

}

END

" Instructions:
" -------------------------------------------------------------
" Load this config with nvim_isolated_conf.sh -l [redacted]/config
" Remember to run :PlugInstall after changing plugin section
" Also delete the comments before putting this file on issue
" That will reduce noise
" You can delete [redacted]/config once you're done

Additional information

https://github.com/neovim/neovim/commit/e049c6e4c08a141c94218672e770f86f91c27a11 made statustext etc. inherit styles from StatusLine etc.

daveyarwood commented 1 month ago

I've started experiencing this too, after updating Neovim recently.

Before updating:

2024-10-22-163832_1920x43_scrot

After updating:

2024-10-22-163853_1920x41_scrot

sozelfist commented 1 month ago

I also got the same problem as the one @daveyarwood has mentioned here after updating neovim.

Before updating: I don't have an image here

After updating: image

weskoerber commented 4 weeks ago

Related discussion: https://github.com/nvim-lualine/lualine.nvim/discussions/1309

xxheyhey commented 3 weeks ago

I added this to my configuration:

vim.api.nvim_set_hl(0, "StatusLine", {reverse = false})
vim.api.nvim_set_hl(0, "StatusLineNC", {reverse = false})

This is a workaround that makes my lualine normal again.

For some themes (like ellisonleao/gruvbox.nvim) you can also do this:


...

config = function()
  require(plugin).setup({
    inverse = false,
  }
end

...
daveyarwood commented 3 weeks ago

I added this to my configuration:

vim.api.nvim_set_hl(0, "StatusLine", {reverse = false})
vim.api.nvim_set_hl(0, "StatusLineNC", {reverse = false})

This works for me. Thanks for the workaround!

shadmansaleh commented 3 weeks ago

See if #1315 fixes this

weskoerber commented 3 weeks ago

1315 fixes this for me :+1:

Ontonator commented 2 weeks ago

1315 is better, but still has two issues for me:

  1. the tab line is still broken (I think you're missing TabLineSel and TabLineFill); and
  2. when using vertical splits, the character to the left of the status line (under the window separator) is not highlighted properly (see attached image).

image