aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2020-06-24 16:45:17 +0200
committerKiyan Yazdani <yazdani.kiyan@protonmail.com>2020-06-26 13:52:59 +0200
commit75bce1dc93293f4f1dfd1541386afb607f09d726 (patch)
tree961b27574433bf9213cc395da1a803473a68f028
parentPython highlights: Add walrus operator (diff)
downloadnvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.tar
nvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.tar.gz
nvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.tar.bz2
nvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.tar.lz
nvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.tar.xz
nvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.tar.zst
nvim-treesitter-75bce1dc93293f4f1dfd1541386afb607f09d726.zip
Python highlights: Reset highlighting in f-string interpolation
This solution is preferable to `(identifier) @Normal` since otherwise everything without highlight will use string-highlighting.
-rw-r--r--queries/python/highlights.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index e238a9a8e..ca0f84387 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -1,9 +1,10 @@
;; From tree-sitter-python licensed under MIT License
; Copyright (c) 2016 Max Brunsfeld
-; Identifier naming conventions
+; Reset highlighing in f-string interpolations
+(interpolation) @Normal
-(identifier) @Normal
+; Identifier naming conventions
((identifier) @type
(match? @type "^[A-Z]"))
((identifier) @constant