Skip to content

Commit b17b727

Browse files
committed
fix(treesitter): don't hl keys in lua table literals
This brings it more in-line with GitHub.com, and also seems to improve contrast and legibility (especially when all the values are numbers).
1 parent 41c8c35 commit b17b727

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ misc
55
node_modules/
66
/cache
77
/.cache
8+
9+
# Lua LSP
10+
/.log
11+
/.meta

lua/github-theme/config.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ local M = { theme = 'github_dark', has_options = false }
77
-- TODO: improve type of `specs` and `palettes`
88
---@class (exact) GhTheme.Config
99
---@field options? GhTheme.Config.Options
10-
---@field palettes? table<GhTheme.Theme|"all", table>
11-
---@field specs? table<GhTheme.Theme|"all", table>
12-
---@field groups? table<GhTheme.Theme|"all", table<string, GhTheme.HighlightGroup>>
10+
---@field palettes? table<GhTheme.Theme|"all", table>|false
11+
---@field specs? table<GhTheme.Theme|"all", table>|false
12+
---@field groups? table<GhTheme.Theme|"all", table<string, GhTheme.HighlightGroup|false>>|false
1313

1414
---@class (exact) GhTheme.Config.Module
1515
---@field enable? boolean whether to set plugin-specific highlights for this module/plugin

lua/github-theme/group/modules/treesitter.lua

+3-2
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,14 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch
264264
['@lsp.type.variable.lua'] = { fg = spec.variable },
265265
['@constructor.lua'] = { fg = syn.bracket }, -- {}
266266
['@operator.lua'] = { fg = syn.keyword, style = stl.operators },
267-
-- ['@property'] = { fg = syn.variable },
267+
['@property.lua'] = { fg = syn.ident },
268268
-- ['@function.call.lua'] = { fg = syn.const },
269269
-- ['@function.method.call.lua'] = { link = '@function.call.lua' },
270270
['@function.builtin.lua'] = { fg = syn.builtin0, style = stl.functions },
271271
['@module.builtin.lua'] = { fg = syn.builtin0, style = stl.variables }, -- `table`, `io`, `_G`
272272
-- ['@label.lua'] = { fg = syn.string }, -- The `LABEL` in `::LABEL::` and `goto LABEL`
273-
['@variable.member.luadoc'] = { link = '@variable.member.lua' },
273+
['@property.luadoc'] = { link = '@property.lua' },
274+
['@variable.member.luadoc'] = { link = '@property.luadoc' },
274275
['@operator.luadoc'] = { fg = spec.fg1 }, -- The `|` in `string|number`
275276
['@markup.list.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?`
276277

0 commit comments

Comments
 (0)