Skip to content

feat: cache colors#236

Open
s-cerevisiae wants to merge 4 commits into
zenbones-theme:mainfrom
s-cerevisiae:cache
Open

feat: cache colors#236
s-cerevisiae wants to merge 4 commits into
zenbones-theme:mainfrom
s-cerevisiae:cache

Conversation

@s-cerevisiae
Copy link
Copy Markdown
Contributor

@s-cerevisiae s-cerevisiae commented May 17, 2026

This PR adds cache for colors and palettes, following the practice of tokyonight.nvim. Colorschemes are compiled into a messagepack table on first load, and subsequent loads doesn't load lush.nvim at all. The startup time is reduced to ~2ms on my machine (on par with pre-compiled solution in #235), while allowing for configuration.

Note: a version field is added to zenbones.util which is expected to be updated by release-please. Not sure if it works this way.

Fixes #98.

TODO:

  • Fix option cache for randombones
  • Add an option to opt-out of caching
  • Refactor each colorscheme so that get_global_config is not called twice Not necessary as this only happens once per cache write
  • Less duplicated code in term.lua?

@s-cerevisiae s-cerevisiae force-pushed the cache branch 3 times, most recently from 9d9f7ac to 7e6f443 Compare May 17, 2026 14:54
@s-cerevisiae s-cerevisiae marked this pull request as ready for review May 17, 2026 15:43
@s-cerevisiae s-cerevisiae force-pushed the cache branch 2 times, most recently from f5aea17 to 2695008 Compare May 18, 2026 15:35
@s-cerevisiae
Copy link
Copy Markdown
Contributor Author

s-cerevisiae commented May 18, 2026

Okay screw this CI-only tool, I've tried my best but if release-please still doesn't work after merging let's revert all the JSONs and switch to reading a version.txt file that contains 4.12.0 (which should be automatically updated) as I have zero ways to verify the config in action.

@evantravers
Copy link
Copy Markdown
Contributor

I love this idea… watching with interest.

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

Successfully merging this pull request may close these issues.

Cache generated specs

2 participants