From ff52bd7027ec579a82f8f88e94341407092bf81b Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 26 Jul 2019 13:01:58 +0300 Subject: [PATCH] rc python: Highlight indented decorators with `.` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- rc/filetype/python.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 " }