projekt0n / github-nvim-theme

GitHub's Neovim themes
MIT License
2.11k stars 106 forks source link

Cannot use the hl group override feature #292

Closed kraftwerk28 closed 2 months ago

kraftwerk28 commented 1 year ago

config.lua:

require("github-theme").setup({
  groups = {
    all = {
      StatusLine = { link = "Error" },
    },
  },
})

vim.cmd.colorscheme("github_dark_dimmed")

Now running neovim with

$ nvim --noplugin -u config.lua config.lua

image

It seems that overrides work fine with github_dark and github_dark_colorblind colorscheme but are broken with github_dark_dimmed, github_dark_high_contrast.

tmillr commented 1 year ago

Seems like I can reproduce this, and it appears to be a bug having to do with the compiler/cache (stale cache, false/incorrect cache hit, etc.) (i.e. if you delete the cache first and then run this it works fine or as expected). This requires debugging and further investigation. Thank you for the bug report.

In the meantime, you can try:

Related #262

ful1e5 commented 1 year ago

Closing due to inactivity. Can reopen later.

wadefletch commented 10 months ago

Was facing a similar issue (configured styles not being applied), and :GithubThemeCompile resolved it. Is there a way to automatically run that on config changes? Is that the expected behavior?

tmillr commented 3 months ago

This appears to be resolved as of the latest HEAD (4f44a5c930372c85483d02700f332d34417e50b2), and the fix should be included in v1.0.2 as well. This issue may be closed.

tmillr commented 2 months ago

Was facing a similar issue (configured styles not being applied), and :GithubThemeCompile resolved it. Is there a way to automatically run that on config changes?

@wadefletch Yes, you could always define a VimEnter autocmd or something similar, but it should be fixed now. Just update your plugin and you should be all good. 👍

Is that the expected behavior?

No, it was due to a bug in the compiler code. The compiler relies on a custom hash function and compiles your config together with theme settings from the plugin to a lua bytecode file. Its purpose is to improve nvim's startup time when loading plugins during startup (which it does).


Please open a new issue and/or respond here with a comment if you face any similar issues in the future.