Stop editor defaults from leaking into highlight groups - #49
Merged
Merged
Conversation
`:hi` merges into a group's existing attributes, so every key the
generator left out kept the editor's default: Vim's SpellBad kept
ctermbg=12, Identifier stayed bold and Visual got guifg=LightGrey;
Neovim's Pmenu kept cterm=reverse and Visual ctermfg=0. highlight()
now writes every key and uses NONE where dogrun sets nothing, as the
original hand-written colorscheme did.
- Give SpellCap and DiagnosticUnderline{Info,Hint,Ok} a dogrun underline
color; they relied on the leaked defaults to be told apart
- Use yellow for *ChangeDelete signs and pink for the Deleted icons;
difftextbg is a background color and was nearly invisible (1.54:1)
- Define Operator so legacy syntax matches @operator
- Emit g:terminal_ansi_colors for Vim's :terminal
- Remove 16 unused palette entries and name the color and group when a
palette lookup fails
- Run the generator binary Cargo built in integration tests instead of
a nested `cargo run`
Co-Authored-By: Claude Opus 5.5 (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.
Summary
:himerges into a group's existing attributes, so every key the generator omitted kept the editor's default instead of meaning "unset". Aftercolorscheme dogrun:ctermbg=12/9/11/13(bright red/blue backgrounds on misspelled words in 256-color terminals),Identifierstayed bold,Visualgotguifg=LightGrey(syntax colors lost inside a selection),Underlinedkept a blue fg, and several message/diff groups stayed bold.Pmenukeptcterm=reverseandVisualkeptctermfg=0(visible without termguicolors),MatchParenandDiffDeletestayed bold, and every Spell/Diagnostic underline used Neovim's own palette as its underline color.highlight()now writes all seven keys (guifg ctermfg guibg ctermbg guisp gui cterm) and usesNONEwhere dogrun sets nothing, which is what the original hand-written colorscheme did.Related changes:
SpellCapandDiagnosticUnderline{Info,Hint,Ok}only had an underline and relied on the leaked defaults to be told apart; they now get a dogrun underline color (yellow/infofg) while keeping the text color.GitSignsChangeDelete/GitGutterChangeDeleteuseddifftextbg, a background color (1.54:1 contrast onmainbg); they now use the Change color.NvimTreeGitDeletedIcon/FylerGitDeleteduse pink.Operatorwas undefined, so legacy syntax in Neovim rendered operators in Neovim's default grey; it now matches@operator(purple).:terminalnow gets the same 16 colors viag:terminal_ansi_colors(used by Vim with termguicolors or in the GUI).CARGO_BIN_EXE_dogrun) instead of a nestedcargo run.term=attributes are intentionally left alone: dogrun defines none, so the editor defaults remain the only thing that works on monochrome terminals.Verification
just check(fmt, clippy, all tests including the golden byte-compare) passes; new tests assert everyhiline carries all seven keys and that the Vim branch sets 16 ANSI colors.nvim_get_hl()/hlget(): groups holding a value dogrun did not set went from 13 → 0 (Neovim) and 12 → 0 (Vim).GitSignsStagedChangedelete, which gitsigns derives fromGitSignsChangedelete).References
🤖 Generated with Claude Code