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

fix(Color): don't use shared global state (Color.BG etc.) #363

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

tmillr
Copy link
Member

@tmillr tmillr commented Aug 8, 2024

Fix bug where the colorscheme colors are off/incorrect when a palette is require()'d, whether directly or indirectly, anytime before compilation occurs (e.g. compilation that occurs during colorscheme load). For details, see issue #362.

Also, add a test (in test/) which disallows the direct or indirect use of the global static/class fields of the Color class (e.g. Color.BG).

Fixes: #362

@tmillr tmillr force-pushed the fix-color-global-state branch 2 times, most recently from ff121e8 to e1ed985 Compare August 8, 2024 04:05
@tmillr tmillr force-pushed the fix-color-global-state branch 7 times, most recently from e749c06 to fbd3544 Compare August 9, 2024 00:46
@tmillr tmillr changed the title fix(Color): don't use shared global state fix(Color): don't use shared global state (Color.BG etc.) Aug 9, 2024
@tmillr tmillr force-pushed the fix-color-global-state branch from fbd3544 to d3e28a2 Compare August 9, 2024 03:27
@tmillr tmillr added the bug Something isn't working label Aug 9, 2024
Fix bug where the colorscheme colors are off/incorrect when a palette is
require()'d, whether directly or indirectly, anytime before compilation
occurs (e.g. compilation that occurs during colorscheme load). For
details, see issue projekt0n#362.

Also, add a test (in `test/`) which disallows the direct or indirect use
of the global static/class fields of the `Color` class (e.g.
`Color.BG`).

Fixes: projekt0n#362
@tmillr tmillr force-pushed the fix-color-global-state branch from d3e28a2 to 0a358a3 Compare August 9, 2024 04:05
@tmillr tmillr merged commit 742c701 into projekt0n:main Aug 9, 2024
25 checks passed
@tmillr tmillr deleted the fix-color-global-state branch August 9, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading palette or spec before colorscheme disrupts colors
1 participant