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

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

Open
2 tasks done
Ontonator opened this issue Oct 21, 2024 · 8 comments · May be fixed by #1315
Open
2 tasks done

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

Ontonator opened this issue Oct 21, 2024 · 8 comments · May be fixed by #1315
Assignees
Labels
bug Something isn't working

Comments

@Ontonator
Copy link

Self Checks

  • I'm using the latest lualine.
  • I didn't find the issue in existing issues or PRs.

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

neovim/neovim@e049c6e made statustext etc. inherit styles from StatusLine etc.

@Ontonator Ontonator added the bug Something isn't working label Oct 21, 2024
@daveyarwood
Copy link

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
Copy link

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
Copy link

Related discussion: #1309

@xxheyhey
Copy link

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
Copy link

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 shadmansaleh self-assigned this Oct 30, 2024
@shadmansaleh shadmansaleh linked a pull request Oct 30, 2024 that will close this issue
@shadmansaleh
Copy link
Member

See if #1315 fixes this

@weskoerber
Copy link

#1315 fixes this for me 👍

@Ontonator
Copy link
Author

#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants