NvChad / base46

NvChad's base46 theme plugin with caching ( Total re-write )
Other
187 stars 194 forks source link

Theme highlights don't fully load #184

Closed endoze closed 1 year ago

endoze commented 1 year ago

Describe the bug After a fresh install of NvChad, when I close and re-open neovim, not all of the theme highlight groups seem to be set properly.

To Reproduce Steps to reproduce the behavior:

mkdir ~/.config/bare # this relies on XDG_CONFIG_HOME being ~/.config, modify as needed based on your XDG_CONFIG_HOME value
git clone https://github.com/NvChad/NvChad ~/.config/bare --depth 1
cd ~/.config/bare
NVIM_APPNAME='bare' nvim
# Choose to use the generated custom files, close as instructed
NVIM_APPNAME='bare' nvim lua/custom/chadrc.lua 
# at this point highlights are partially loaded
# we can force them to be fully loaded with `:lua require('base46').load_all_highlights()`

Expected behavior The theme highlight groups should all be loaded upon opening Neovim.

Screenshots

https://user-images.githubusercontent.com/997161/233466211-f2d92545-7af8-4c4e-ba3d-e2c309cba26e.mp4

Desktop (please complete the following information):

siduck commented 1 year ago

cant reproduce

https://0x0.st/HKPT.mp4

endoze commented 1 year ago

@siduck Something worth mentioning is inside of a Tmux session, this problem doesn't occur for me. It's only when I start everything outside of tmux. I'm curious if my $TERM setting is related to why it's only outside Tmux and you are unable to reproduce?

My $TERM outside of tmux (set via Alacritty configuration) is xterm-256color. My $TERM inside of tmux (set via tmux.conf) is screen-256color. I'm not sure what terminal program you are using but what $TERM does Neovim report in the case where yours works?

siduck commented 1 year ago

mine image

can you try other terminals? like wezterm kitty, i think even alacritty should work fine

endoze commented 1 year ago

I've tried several other terminals (iTerm2, kitty) and I think I can finally recreate the issue properly now. You need to be using a light color scheme in your terminal and then do the steps listed in the original issue. Here's a short video showing both a light color scheme for my Alacritty configuration and then a dark color scheme for my Alacritty configuration.

https://user-images.githubusercontent.com/997161/234087093-907c5cb3-d3d4-4c5b-9593-4bfeba6f08f5.mov

Here are the color schemes I used in Alacritty in the video:

# solarized-light

colors:
  primary:
    background: '#fdf6e3' # base3
    foreground: '#657b83' # base00
  normal:
    black:   '#073642' # base02
    red:     '#dc322f' # red
    green:   '#859900' # green
    yellow:  '#b58900' # yellow
    blue:    '#268bd2' # blue
    magenta: '#d33682' # magenta
    cyan:    '#2aa198' # cyan
    white:   '#eee8d5' # base2
  bright:
    black:   '#002b36' # base03
    red:     '#cb4b16' # orange
    green:   '#586e75' # base01
    yellow:  '#657b83' # base00
    blue:    '#839496' # base0
    magenta: '#6c71c4' # violet
    cyan:    '#93a1a1' # base1
    white:   '#fdf6e3' # base3
# solarized-dark

colors:
  primary:
    background: '0x002b36'
    foreground: '0x839496'
  normal:
    black:   '0x073642'
    red:     '0xdc322f'
    green:   '0x859900'
    yellow:  '0xb58900'
    blue:    '0x268bd2'
    magenta: '0xd33682'
    cyan:    '0x2aa198'
    white:   '0xeee8d5'
  bright:
    black:   '0x002b36'
    red:     '0xcb4b16'
    green:   '0x586e75'
    yellow:  '0x657b83'
    blue:    '0x839496'
    magenta: '0x6c71c4'
    cyan:    '0x93a1a1'
    white:   '0xfdf6e3'
siduck commented 1 year ago

will look into this, i can reproduce it now

image

siduck commented 1 year ago

@endoze happens only in alacritty for me, kitty works fine and other terminals too...

siduck commented 1 year ago

i see that the "bg" opt isnt being set in such terminals when light theme is set

proof :

https://user-images.githubusercontent.com/59060246/236619598-affb7352-000e-4a5c-a127-4f098ca9f0e6.mp4

Alacritty with dark theme :

image Alacritty with light theme : image

siduck commented 1 year ago

@endoze just add this in your custom init.lua for now

vim.schedule(function()
  dofile(vim.g.base46_cache .. "defaults")
end)

This is a neovim issue, https://github.com/neovim/neovim/issues/22614

siduck commented 1 year ago

@nullchilly how do you handle this in catpucin?

nullchilly commented 1 year ago

I asked user to use this workaround:

{ "catppuccin/nvim", name = "catppuccin", opts = { background = { light = "mocha" } } }
antony-frolov commented 1 year ago

@endoze just add this in your custom init.lua for now

vim.schedule(function()
  dofile(vim.g.base46_cache .. "defaults")
end)

This is a neovim issue, neovim/neovim#22614

Screenshot 2023-05-08 at 12 05 13 Screenshot 2023-05-08 at 12 06 25

This fix seems to break highlighting for me

jetaggart commented 1 year ago

@endoze just add this in your custom init.lua for now

vim.schedule(function()
  dofile(vim.g.base46_cache .. "defaults")
end)

This is a neovim issue, neovim/neovim#22614

This is happening to me in iterm2 macos still. This fixed it, thank you! Any idea if there's a true fix for this or is this just how it it is?

siduck commented 1 year ago

@jetaggart we will have to either wait for the upstream fix or you can use another terminal

jetaggart commented 1 year ago

Got it, thank you!

siduck commented 1 year ago

Got it, thank you!

btw this issue will occur only if your terminal has a light theme, I think . So just use a dark theme :D

jetaggart commented 1 year ago

I'm a fan of torch mode, can't teach an old dog new tricks 🧓