github-nvim-theme icon indicating copy to clipboard operation
github-nvim-theme copied to clipboard

Cannot use the hl group override feature

Open kraftwerk28 opened this issue 2 years ago • 4 comments

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.

kraftwerk28 avatar Aug 05 '23 05:08 kraftwerk28

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:

  • Running nvim without --noplugin (may or may not help anything)
  • Forcing a theme/colorscheme compilation with :GithubThemeCompile. For example, if you do nvim --noplugin -u config.lua config.lua, then run :GithubThemeCompile, then quit nvim and reopen it again with nvim --noplugin -u config.lua config.lua, you should see that things are working as expected (i.e. StatusLine will be linked to Error)

Related #262

tmillr avatar Aug 06 '23 19:08 tmillr

Closing due to inactivity. Can reopen later.

ful1e5 avatar Sep 23 '23 07:09 ful1e5

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?

wadefletch avatar Nov 29 '23 00:11 wadefletch

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 avatar Jun 27 '24 07:06 tmillr

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.

tmillr avatar Jul 11 '24 20:07 tmillr