Skip to content

Commit cfd8b55

Browse files
committed
fix(treesitter): highlight of imported names in python
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
1 parent 0e4636f commit cfd8b55

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
1616

1717
- Fixed JSX/TSX tags are missing highlights with nvim 0.10 (#360)
1818
- Fixed loading palette or spec before colorscheme disrupts colors (#362 fixed-by #363)
19+
- Fixed incorrect highlight of name/binding in python import statements (#371)
1920

2021
## [v1.1.2] - 05 August 2024
2122

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch
301301
['@type.builtin.python'] = { link = '@constant' },
302302
-- ['@type.python'] = { link = '@function' },
303303
['@variable.builtin.python'] = { link = '@constant' },
304+
['@module.python'] = FALLBACK_OR_NONE,
304305

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

0 commit comments

Comments
 (0)