f4z3r / gruvbox-material.nvim

Material Gruvbox colorscheme for Neovim written in Lua
MIT License
32 stars 4 forks source link

"^" fill character set in statusbar #22

Closed logan-connolly closed 2 months ago

logan-connolly commented 2 months ago

Hi @f4z3r ,

First off, great work on this project. You were definitely the right person to fork the plugin! It has been exciting to see the progress.

However, I discovered a change in behavior after the large refactor commit: https://github.com/f4z3r/gruvbox-material.nvim/commit/16f937cdedc85ec5359c529750fcfc6ca433246c. Starting with this commit, the statusbar is populated with the "^" fill character (see :help fillchars for more info).

I am not sure what exactly caused this change. I landed upon this commit by doing a git bisect. I plan to investigate more in the coming days.

Screenshots

swappy-20240509_171445

swappy-20240509_165906

f4z3r commented 2 months ago

Hi @logan-connolly, thanks a lot! Mhhh this is very strange. I am planning on working only half the day tomorrow, and get some time for OSS. I might also have a look, this is very intriguing ...

f4z3r commented 2 months ago

Any one that is omitted will fall back to the default. For "stl" and "stlnc" the space will be used when there is highlighting, '^' or '=' otherwise.

Interesting, I am guessing the status line was getting highlighting before, and not anymore. This is very strange though, considering I did not change or remove any groups in the refactor, so all of them should still be there and be highlighted exactly the same (only changes I did where 2 typos for bold)...

logan-connolly commented 2 months ago

I found the culprit! Commenting out this line resolves the issue, but I don't fully understand why... or what implications removing this highlight group would have:

diff --git a/lua/gruvbox-material/groups.lua b/lua/gruvbox-material/groups.lua
index 899b62d..2d6472f 100644
--- a/lua/gruvbox-material/groups.lua
+++ b/lua/gruvbox-material/groups.lua
@@ -158,7 +158,7 @@ return {

   StatusLine = { fg = colors.fg1, bg = colors.bg_statusline1 }, -- status line of current window
   StatusLineTerm = { link = "StatusLine" }, -- status line of current :terminal window
-  StatusLineNC = { fg = colors.fg1, bg = colors.bg_statusline1 }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
+  -- StatusLineNC = { fg = colors.fg1, bg = colors.bg_statusline1 }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
   StatusLineTermNC = { link = "StatusLineNC" }, -- status line of non-current :terminal window
   TabLine = { fg = colors.fg1, bg = colors.bg_statusline3 },
   TabLineFill = { fg = colors.fg1, bg = colors.bg_statusline1 },

Related reddit thread: https://www.reddit.com/r/neovim/comments/wpwkux/floating_windows_seem_to_override_fillchars/

f4z3r commented 2 months ago

Mhhh this super strange, since it seems that it now behaves correctly and did not before the refactor. The configuration (both before refactor and after) had StatusLine == StatusLineNC (same fg and bg) so according to the documentation, it makes sense that it should print ^^^.... So I guess it did not get picked up before the refactoring for some reason?

Question now would be whether we want to have non-current statuslines have different backgrounds or a dimmed foreground? I am guessing most people use status line plugins and will not be affected by this, so changing the theme slightly here should not be an issue. What do you think?

logan-connolly commented 2 months ago

Yeah, I like the idea of having a dimmed/muted foreground. Are you cool with colors.grey1? If yes, I will go ahead a make a PR.