diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-28 11:00:51 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-10-28 13:43:04 +0800 |
| commit | d49555fc7568cff0db385d019a68cfdb0f28f8b0 (patch) | |
| tree | 54c852fe6bba4236baf632111341312547ed77f8 /rc/base/lua.kak | |
| parent | 9a449a33446f1c52bb02b4bea13bbc86d5742f2d (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/base/lua.kak')
| -rw-r--r-- | rc/base/lua.kak | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rc/base/lua.kak b/rc/base/lua.kak index 9b453dbf..46979484 100644 --- a/rc/base/lua.kak +++ b/rc/base/lua.kak @@ -11,17 +11,17 @@ hook global BufCreate .*[.](lua) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter -group / regions -default code lua \ +add-highlighter shared/ regions -default code lua \ string '"' (?<!\\)(\\\\)*" '' \ string "'" (?<!\\)(\\\\)*' '' \ comment '--' '$' '' \ comment '--\[\[' '\]\]' '' \ -add-highlighter -group /lua/string fill string +add-highlighter shared/lua/string fill string -add-highlighter -group /lua/comment fill comment +add-highlighter shared/lua/comment fill comment -add-highlighter -group /lua/code regex \b(and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b 0:keyword +add-highlighter shared/lua/code regex \b(and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b 0:keyword # Commands # ‾‾‾‾‾‾‾‾ @@ -92,7 +92,7 @@ def -hidden lua-insert-on-new-line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group lua-highlight global WinSetOption filetype=lua %{ add-highlighter ref lua } +hook -group lua-highlight global WinSetOption filetype=lua %{ add-highlighter window ref lua } hook global WinSetOption filetype=lua %{ hook window InsertChar .* -group lua-indent lua-indent-on-char @@ -102,7 +102,7 @@ hook global WinSetOption filetype=lua %{ alias window alt lua-alternative-file } -hook -group lua-highlight global WinSetOption filetype=(?!lua).* %{ remove-highlighter lua } +hook -group lua-highlight global WinSetOption filetype=(?!lua).* %{ remove-highlighter window/lua } hook global WinSetOption filetype=(?!lua).* %{ remove-hooks window lua-indent |
