fix(theme): NeoVim body follows the variant, not just the tabline - #110
Merged
Merged
Conversation
Setting a non-dark variant (sepia/white) only recolored the tabline; the
editor body stayed dark blue.
Root cause is load order. alchemists-orchid.nvim ships plugin/*.lua that
eagerly runs `setup()` (its dark default) plus `colorscheme
alchemists-orchid`, and Vim sources plugin/ scripts AFTER init.vim. So the
sequence was:
1. init.vim sources generated/palette.vim → setup({mode='light'}) → body
correctly becomes sepia/white.
2. After init.vim, Vim auto-runs the plugin's plugin/*.lua → setup() (dark)
→ body reverts to dark.
The plugin's own `colorscheme alchemists-orchid` in step 2 fires Potions'
ColorScheme autocmd, which repaints only the barbar tabline / Visual / cheat
groups from the variant tokens — so the tabline tracked the variant while the
body did not. Exactly the reported symptom.
Fix: in the nvim adapter, wrap the body apply in a re-callable global
`PotionsApplyOrchid()` (still invoked immediately, so live `:source` /
`potions reload` keeps winning — no plugin pass follows a live source), and
add a startup-only `VimEnter` guard that re-asserts the variant after the
plugin's eager pass, then re-asserts the component highlights on top. The
guard is gated on `has('vim_starting')` so live re-sources skip it.
Verified end-to-end under the real init.vim: Normal resolves to #2e3440
(dark), #fafbfc (white), #f5f0e6 (sepia) for the three variants. Two
regression assertions lock in the re-assert guard. 270 tests pass.
Bump .version 2.15.2 + regenerate .checksums.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Setting a non-dark variant (sepia/white) only recolored the NeoVim tabline — the editor body stayed dark blue.
Root cause — load order
alchemists-orchid.nvim(v2.0) shipsplugin/alchemists-orchid.luathat eagerly runssetup()(its dark default) pluscolorscheme alchemists-orchid. Vim sourcesplugin/**scripts afterinit.vim, so:init.vimsourcesgenerated/palette.vim→setup({mode='light'})→ body correctly becomes sepia/white.plugin/*.lua→setup()(dark) → body reverts to dark.That step-2
colorscheme alchemists-orchidfires Potions'ColorSchemeautocmd, which repaints only the barbar tabline / Visual / cheat groups from the variant tokens — so the tabline tracked the variant while the body did not. Exactly the reported symptom.Proven empirically: under the real
init.vim,Normalresolved to#2e3440(dark); re-sourcingpalette.vimflipped it to the parchment surface.Fix
In the nvim adapter (
.potions/lib/theme/adapters.sh):PotionsApplyOrchid()(still invoked immediately — so live:source/potions reloadkeeps winning, since no plugin pass follows a live source).VimEnterguard (has('vim_starting')) that re-asserts the variant after the plugin's eager pass, then re-asserts the component highlights on top.Verification
End-to-end under the real
init.vim, post-VimEnter:Normalbgbackground#2e3440#fafbfc#f5f0e6PotionsApplyOrchid+ theVimEnterre-assert)..version→ 2.15.2,.checksumsregenerated.🤖 Generated with Claude Code