From c106c9472154d6b2c74b74565616b877ae8ed31d Mon Sep 17 00:00:00 2001 From: Payton Ward <72841140+paytonward6@users.noreply.github.com> Date: Tue, 31 Dec 2024 04:32:00 -0600 Subject: [PATCH] fix(treesitter): elixir module/atom colors (#366) * fix(Color): use proper Elixir module/atom colors * fix(treesitter): elixir module/atom colors - Fix highlight of modules (module names) in elixir. - Link `@string.special.symbol` -> `@constant`, which fixes/improves the highlight of symbols/atoms in elixir. NOTE: Technically, github.com uses the string color (i.e. `@string`) for elixir atoms currently, but other langs (e.g. Ruby) use the constant (i.e. `@constant`) color. We'll let elixir use the default of `@constant` for now for consistency and simplicity. --------- Co-authored-by: Tyler Miller --- CHANGELOG.md | 1 + lua/github-theme/group/modules/treesitter.lua | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5287ad7..5210220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic - Fixed JSX/TSX tags are missing highlights with nvim 0.10 (#360) - Fixed loading palette or spec before colorscheme disrupts colors (#362 fixed-by #363) - Fixed incorrect highlight of name/binding in python import statements (#371) +- Fixed elixir module/atom colors (#366) ## [v1.1.2] - 05 August 2024 diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index 2cbf241..7f0e741 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -80,7 +80,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@string.escape'] = { fg = syn.regex, style = 'bold' }, -- Escape characters within a string: `\n`, `\t`, etc. -- ['@string.special'] = { link = 'Special' }, -- Other special strings (e.g. dates) - ['@string.special.symbol'] = { fg = syn.preproc }, -- Symbols or atoms + ['@string.special.symbol'] = { link = '@constant' }, -- Symbols or atoms ['@string.special.url'] = { fg = syn.const, style = 'italic,underline' }, -- URIs (e.g. hyperlinks) -- ['@string.special.path'] = { fg = spec.palette.done.fg }, -- Filenames @@ -307,6 +307,9 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@label.ruby'] = { fg = syn.const }, ['@string.special.symbol.ruby'] = { link = '@constant' }, + -- Elixir + ['@module.elixir'] = { link = '@type' }, + -- Rust ['@constant.builtin.rust'] = { fg = pl.syntax.variable }, ['@module.rust'] = FALLBACK_OR_NONE,