summaryrefslogtreecommitdiff
path: root/rc/filetype/python.kak
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2019-07-26 13:01:58 +0300
committerFrank LENORMAND <lenormf@gmail.com>2019-07-26 13:01:58 +0300
commitff52bd7027ec579a82f8f88e94341407092bf81b (patch)
treee4550bf0132b796f106b2072ca166fcf0c08cf11 /rc/filetype/python.kak
parent550feb1706e248edd4fe0cf526c12cdefbfab7ce (diff)
rc python: Highlight indented decorators with `.`
Make sure decorators are on their own line, and don't stop highlighting at the first dot when they are imported, e.g. ``` import enum @enum.unique class A(enum.Enum): … ``` Ideally highlighting shouldn't stop at the first parenthesis either (e.g. `@foo(['1'])`), but the current code somewhat highlights the contents of the parens already, which is good enough in most cases.
Diffstat (limited to 'rc/filetype/python.kak')
-rw-r--r--rc/filetype/python.kak2
1 files changed, 1 insertions, 1 deletions
diff --git a/rc/filetype/python.kak b/rc/filetype/python.kak
index 7c4472a3..91dcb1ef 100644
--- a/rc/filetype/python.kak
+++ b/rc/filetype/python.kak
@@ -130,7 +130,7 @@ evaluate-commands %sh{
add-highlighter shared/python/code/ regex '\b($(join "${keywords}" '|'))\b' 0:keyword
add-highlighter shared/python/code/ regex '\b($(join "${functions}" '|'))\b\(' 1:builtin
add-highlighter shared/python/code/ regex '\b($(join "${types}" '|'))\b' 0:type
- add-highlighter shared/python/code/ regex '@[\w_]+\b' 0:attribute
+ add-highlighter shared/python/code/ regex '^\h*(@[\w_.]+))' 1:attribute
"
}