summaryrefslogtreecommitdiff
path: root/rc/core/python.kak
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-28 11:00:51 +0800
committerMaxime Coste <mawww@kakoune.org>2017-10-28 13:43:04 +0800
commitd49555fc7568cff0db385d019a68cfdb0f28f8b0 (patch)
tree54c852fe6bba4236baf632111341312547ed77f8 /rc/core/python.kak
parent9a449a33446f1c52bb02b4bea13bbc86d5742f2d (diff)
Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and window scope. The add-highlighter and remove-highlighter syntax changed to take the parent path (scope/group/...) as a mandatory argument, superseeding the previous -group switch.
Diffstat (limited to 'rc/core/python.kak')
-rw-r--r--rc/core/python.kak24
1 files changed, 12 insertions, 12 deletions
diff --git a/rc/core/python.kak b/rc/core/python.kak
index fcd749d5..15e94806 100644
--- a/rc/core/python.kak
+++ b/rc/core/python.kak
@@ -11,16 +11,16 @@ hook global BufCreate .*[.](py) %{
# Highlighters & Completion
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-add-highlighter -group / regions -default code python \
+add-highlighter shared/ regions -default code python \
double_string '"""' '"""' '' \
single_string "'''" "'''" '' \
double_string '"' (?<!\\)(\\\\)*" '' \
single_string "'" (?<!\\)(\\\\)*' '' \
comment '#' '$' ''
-add-highlighter -group /python/double_string fill string
-add-highlighter -group /python/single_string fill string
-add-highlighter -group /python/comment fill comment
+add-highlighter shared/python/double_string fill string
+add-highlighter shared/python/single_string fill string
+add-highlighter shared/python/comment fill comment
%sh{
# Grammar
@@ -47,16 +47,16 @@ add-highlighter -group /python/comment fill comment
# Highlight keywords
printf %s "
- add-highlighter -group /python/code regex '\b(${values})\b' 0:value
- add-highlighter -group /python/code regex '\b(${meta})\b' 0:meta
- add-highlighter -group /python/code regex '\b(${keywords})\b' 0:keyword
- add-highlighter -group /python/code regex '\b(${functions})\b\(' 1:builtin
+ add-highlighter shared/python/code regex '\b(${values})\b' 0:value
+ add-highlighter shared/python/code regex '\b(${meta})\b' 0:meta
+ add-highlighter shared/python/code regex '\b(${keywords})\b' 0:keyword
+ add-highlighter shared/python/code regex '\b(${functions})\b\(' 1:builtin
"
# Highlight types and attributes
printf %s "
- add-highlighter -group /python/code regex '\b(${types})\b' 0:type
- add-highlighter -group /python/code regex '@[\w_]+\b' 0:attribute
+ add-highlighter shared/python/code regex '\b(${types})\b' 0:type
+ add-highlighter shared/python/code regex '@[\w_]+\b' 0:attribute
"
}
@@ -79,7 +79,7 @@ def -hidden python-indent-on-new-line %{
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-hook -group python-highlight global WinSetOption filetype=python %{ add-highlighter ref python }
+hook -group python-highlight global WinSetOption filetype=python %{ add-highlighter window ref python }
hook global WinSetOption filetype=python %{
hook window InsertChar \n -group python-indent python-indent-on-new-line
@@ -87,7 +87,7 @@ hook global WinSetOption filetype=python %{
hook window InsertEnd .* -group python-indent %{ try %{ exec -draft \; <a-x> s ^\h+$ <ret> d } }
}
-hook -group python-highlight global WinSetOption filetype=(?!python).* %{ remove-highlighter python }
+hook -group python-highlight global WinSetOption filetype=(?!python).* %{ remove-highlighter window/python }
hook global WinSetOption filetype=(?!python).* %{
remove-hooks window python-indent