NvChad / base46

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

Highlight overrides not working #195

Closed ckt114 closed 1 year ago

ckt114 commented 1 year ago

Describe the bug Highlights overrides are not working.

To Reproduce Steps to reproduce the behavior:

  1. Edit custom/highlights.lua
  2. Add fg = "#00cc00" and ctermfg = "#00cc00" to the Comment section
  3. Restart neovim
  4. Run :hi and search for Comment

Expected behavior The foreground color should be bright green.

Screenshots custom/highlights.lua image

Comment didn't change. image

Desktop (please complete the following information):

ckt114 commented 1 year ago

FYI I tried without ctermfg as well but still the same result.

siduck commented 1 year ago

https://github.com/NvChad/NvChad/assets/59060246/7f9cc0c1-16c2-455d-9f3b-10af476e3fbb

unable to reproduce and also cterm stuff isnt supported by base46

ckt114 commented 1 year ago

It is not helpful to just close the ticket and said that it's not reproducible. I wouldn't have put in a ticket if it's working as expected. I did exactly what you did and it isn't working that's why I put in this ticket for help. What do you suggest me doing to troubleshoot instead?

ckt114 commented 1 year ago

Also, I'm getting error below now and even though I've removed fg = "#00ccff" from the highlights.lua the error doesn't stop.

Error detected while processing /Users/ckt114/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /Users/ckt114/.local/share/nvim/nvchad/base46/defaults:0: Invalid highlight color: '#00ccff','
stack traceback:
        [C]: in function 'nvim_set_hl'
        /Users/ckt114/.local/share/nvim/nvchad/base46/defaults: in function </Users/ckt114/.local/share/nvim/nvchad/base46/defaults:0>
        [C]: in function 'dofile'
        /Users/ckt114/.config/nvim/init.lua:19: in main chunk
Press ENTER or type command to continue
siduck commented 1 year ago

Also its not a nvchad issue at all

image

cterm fg expects a number and not a string, there's a reason we use guicolors , because they accept hex values

siduck commented 1 year ago

image

i get the same error because you set an invalid value to ctermfg, just remvoe it please

ckt114 commented 1 year ago

I removed both cterm and fg but the error still persist.

siduck commented 1 year ago

I removed both cterm and fg but the error still persist.

please save the file!!!

and do it with neovim, or else your cache would never reload

ckt114 commented 1 year ago

Are you seriously telling me to save the file? That is so condescending man. Forget it dude.

siduck commented 1 year ago

Are you seriously telling me to save the file? That is so condescending man. Forget it dude.

Why are you being so rude? Think before you talk

Our autocmd reloads the theme i.e recompiles the base46 cache only when you save a file in the custom dir

image

And obviously the autocmd will trigger when you're using neovim only.

If you're using another editor to save your changes, the cache will never recompile

ckt114 commented 1 year ago

I’m not being rude. You’re being condescending in every issue I reported. Forget that I’ve reported this.

siduck commented 1 year ago

I'm not, most of the issues we get aren't even related to nvchad or not actual bugs. Its annoying to see them again and again

siduck commented 1 year ago

https://github.com/NvChad/base46/assets/59060246/c9354593-dc93-4296-97b3-a139d0dd6051

Basically your issue

siduck commented 1 year ago

I will not close this issue until I hear from you that you dont get the issue anymore

ckt114 commented 1 year ago

I did this again to show you that the error still persist even after I have removed the bad line.

These are the steps I took. I edit everything in nvim.

  1. Edit custom/highlights.lua and add the bad line ctermfg = "#00cc00" into Comment
  2. Saved the file and quit nvim
  3. Started nvim again and the error shown
  4. I edited the custom/highlights.lua file again and remove that bad ctermfg line
  5. Saved the file and tried to enter nvim again but the error would not go away

As last resort I had to delete my ~/.local/share/nvim folder for that error to not show again.

https://github.com/NvChad/base46/assets/573808/fbca5cce-f0a7-48ea-b31a-575b801a2e8b

siduck commented 1 year ago

weird, can you add ctermfg again, save the file and remove it again and save the file? and make a video out of it

ckt114 commented 1 year ago

@siduck I've recorded from beginning to end on how I produced that unrecoverable error in video below. The only way to stop that error is for me to remove ~/.local/share/nvim folder.

https://github.com/NvChad/base46/assets/573808/b7e3227d-4920-4024-b38d-69123de02125

siduck commented 1 year ago

ohh @ckt114 i get the error now! i wasnt facing this issue because i had my neovim window opened. But if there's a corrupted base46 cache, then nvchad wont run at all, it not running properly would mean that the autocmd that compiles and reloads the base46 cache wont get triggered.

so a quick fix to this rather than deleting whole local nvim config dir is commenting this line in main init.lua

image

and then save your file again, then uncomment it back :D

ckt114 commented 1 year ago

I did do that. I commented out that line in init.lua and I didn't get that error but once I fixed the highlights.lua and re-enable that line in init.lua I get the same error again.