Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use the hl group override feature #292

Closed
kraftwerk28 opened this issue Aug 5, 2023 · 5 comments
Closed

Cannot use the hl group override feature #292

kraftwerk28 opened this issue Aug 5, 2023 · 5 comments

Comments

@kraftwerk28
Copy link

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
Copy link
Member

tmillr commented Aug 6, 2023

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

@ful1e5
Copy link
Member

ful1e5 commented Sep 23, 2023

Closing due to inactivity. Can reopen later.

@wadefletch
Copy link

wadefletch commented Nov 29, 2023

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?

ful1e5 added a commit that referenced this issue Jan 19, 2024
@tmillr
Copy link
Member

tmillr commented Jun 27, 2024

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

@tmillr
Copy link
Member

tmillr commented Jul 11, 2024

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 tmillr closed this as completed Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants