Skip to content

Commit

Permalink
Merge pull request #289 from tmillr/fix-incorrect-highlights
Browse files Browse the repository at this point in the history
fix(syntax-hl): misc corrections
  • Loading branch information
ful1e5 authored Jul 30, 2023
2 parents 7e08e9c + 7974ec8 commit c2d20c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/github-theme/group/modules/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch
['@constant.builtin.rust'] = { fg = pl.syntax.variable },
['@namespace.rust'] = FALLBACK_OR_NONE,
['@preproc.rust'] = { fg = syn.const },
['@storageclass.lifetime.rust'] = { link = '@tag.rust' },
['@storageclass.lifetime.punctuation.rust'] = { link = '@punctuation.special.rust' },

-- SCSS
['@property.scss'] = { link = '@constant' },
Expand Down
14 changes: 14 additions & 0 deletions lua/github-theme/group/syntax.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ function M.get(spec, config)
diffFile = { fg = spec.diag.info }, -- The filename of the diff ('diff --git a/readme.md b/readme.md')
diffLine = { fg = syn.builtin2 }, -- Line information ('@@ -169,6 +169,9 @@')
diffIndexLine = { fg = syn.preproc }, -- Index line of diff ('index bf3763d..94f0f62 100644')

-- Language specific -------------------------------------------------------

-- Json
jsonKeyword = { fg = syn.tag }, -- Json keys (e.g. `"key": "value"`)
jsonNull = { link = 'Constant' },

-- Lua
luaFunction = { link = 'Keyword' }, -- Function keywords (`function`, `end`) (corrects upstream inaccuracy/bug)
luaTable = FALLBACK_OR_NONE, -- Table brackets (`{}`)

-- Yaml
yamlBlockMappingKey = { fg = syn.tag },
yamlFlowMappingKey = { fg = syn.tag },
}
end

Expand Down
4 changes: 4 additions & 0 deletions queries/rust/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@

; Make crate/self/super the @keyword color
[(crate) (self) (super)] @keyword

; Capture the ' in lifetimes separately
; TODO: upstream this capture
(lifetime "'" @storageclass.lifetime.punctuation)

0 comments on commit c2d20c2

Please sign in to comment.