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

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

Copy link
Copy Markdown
Contributor

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 5 times, most recently from 7e6f443 to d795b47 Compare May 17, 2026 15:29
@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 3 times, most recently from 2695008 to 2e545d4 Compare May 18, 2026 15:50
@s-cerevisiae

s-cerevisiae commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

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鈥β爓atching with interest.

@s-cerevisiae

Copy link
Copy Markdown
Contributor Author

I've been using this in different environments (Linux, macOS, Android) for quite a bit of time and it is working fine for me. Would you like to take a look at it when you have the time? @mcchrish

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