Skip to content

Commit

Permalink
fix(treesitter): highlight of imported names in python
Browse files Browse the repository at this point in the history
Problem:  module names in python import statements are (now) highlighted
          with `@module`, and `@module` has the same highlight as
          keywords (such as `import`).

Cause:    nvim-treesitter update which modifies python's highlight
          query.

Solution: don't highlight `@module.python`. In the future, we may want
          to make `@module` un-highlighted by default instead, since it
          seems that only a few languages need it.

Fixes: #371
  • Loading branch information
tmillr committed Dec 31, 2024
1 parent 0e4636f commit cfd8b55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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)

## [v1.1.2] - 05 August 2024

Expand Down
1 change: 1 addition & 0 deletions lua/github-theme/group/modules/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch
['@type.builtin.python'] = { link = '@constant' },
-- ['@type.python'] = { link = '@function' },
['@variable.builtin.python'] = { link = '@constant' },
['@module.python'] = FALLBACK_OR_NONE,

-- Ruby
['@label.ruby'] = { fg = syn.const },
Expand Down

0 comments on commit cfd8b55

Please sign in to comment.