Skip to content

Commit

Permalink
fix(syntax): incorrect highlight for Delimiter
Browse files Browse the repository at this point in the history
Neovim 0.10 changes or removes some of the default links for builtin hl
groups (e.g. "base" groups). As such, `Delimiter` (and its dependents)
no longer link to `Special`. We rely on the default links for some of
these builtin hl groups.

In `group/syntax.lua`, restore these default links by setting/recreating
them explicitly instead of relying on the defaults.

This commit addresses the groups in `group/syntax.lua`, but there may be
other files or groups that need to be similarly addressed.

Fixes #329
  • Loading branch information
tmillr committed Jun 22, 2024
1 parent d832925 commit eecaa82
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lua/github-theme/group/syntax.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,16 @@ function M.get(spec, config)
PreCondit = { link = 'PreProc' }, -- preprocessor #if, #else, #endif, etc.

Type = { fg = syn.type, style = stl.types }, -- (preferred) int, long, char, etc.
-- StorageClass = { link = 'Type' }, -- static, register, volatile, etc.
-- Structure = { link = 'Type' }, -- struct, union, enum, etc.
-- Typedef = { link = 'Type' }, -- A typedef
StorageClass = { link = 'Type' }, -- static, register, volatile, etc.
Structure = { link = 'Type' }, -- struct, union, enum, etc.
Typedef = { link = 'Type' }, -- A typedef

Special = { fg = spec.fg1 }, -- (preferred) any special symbol
-- Special = { fg = syn.ident }, -- (preferred) any special symbol
-- SpecialChar = { link = 'Special' }, -- special character in a constant
-- Tag = { link = 'Special' }, -- you can use CTRL-] on this
-- Delimiter = { link = 'Special' }, -- character that needs attention
-- SpecialComment = { link = 'Special' }, -- special things inside a comment
-- Debug = { link = 'Special' }, -- debugging statements
SpecialChar = { link = 'Special' }, -- special character in a constant
Tag = { link = 'Special' }, -- you can use CTRL-] on this
Delimiter = { link = 'Special' }, -- character that needs attention
SpecialComment = { link = 'Special' }, -- special things inside a comment
Debug = { link = 'Special' }, -- debugging statements

Underlined = { style = 'underline' }, -- (preferred) text that stands out, HTML links
Bold = { style = 'bold' },
Expand Down Expand Up @@ -118,9 +117,12 @@ function M.get(spec, config)
-- markdownLinkText = {},

-- Diff filetype (runtime/syntax/diff.vim)
diffAdded = { fg = spec.git.add, bg = spec.diff.add }, -- Added lines ('^+.*' | '^>.*')
diffRemoved = { fg = spec.git.removed, bg = spec.diff.delete },-- Removed lines ('^-.*' | '^<.*')
diffChanged = { fg = spec.git.changed, bg = spec.diff.change }, -- Changed lines ('^! .*')
Added = { fg = spec.git.add, bg = spec.diff.add }, -- added line in a diff
Changed = { fg = spec.git.changed, bg = spec.diff.change }, -- changed line in a diff
Removed = { fg = spec.git.removed, bg = spec.diff.delete },-- removed line in a diff
diffAdded = { link = 'Added' }, -- Added lines ('^+.*' | '^>.*')
diffChanged = { link = 'Changed' }, -- Changed lines ('^! .*')
diffRemoved = { link = 'Removed' },-- Removed lines ('^-.*' | '^<.*')
diffOldFile = { fg = spec.diag.warn }, -- Old file that is being diff against
diffNewFile = { fg = spec.diag.hint }, -- New file that is being compared to the old file
diffFile = { fg = spec.diag.info }, -- The filename of the diff ('diff --git a/readme.md b/readme.md')
Expand Down

0 comments on commit eecaa82

Please sign in to comment.