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/java.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/java.kak')
| -rw-r--r-- | rc/base/java.kak | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/rc/base/java.kak b/rc/base/java.kak index c8485b10..3256bfa9 100644 --- a/rc/base/java.kak +++ b/rc/base/java.kak @@ -2,18 +2,18 @@ hook global BufCreate .*\.java %{ set buffer filetype java } -add-highlighter -group / regions -default code java \ +add-highlighter shared/ regions -default code java \ string %{(?<!')"} %{(?<!\\)(\\\\)*"} '' \ comment /\* \*/ '' \ comment // $ '' -add-highlighter -group /java/string fill string -add-highlighter -group /java/comment fill comment +add-highlighter shared/java/string fill string +add-highlighter shared/java/comment fill comment -add-highlighter -group /java/code regex %{\b(this|true|false|null)\b} 0:value -add-highlighter -group /java/code regex "\b(void|int|char|unsigned|float|boolean|double)\b" 0:type -add-highlighter -group /java/code regex "\b(while|for|if|else|do|static|switch|case|default|class|interface|enum|goto|break|continue|return|import|try|catch|throw|new|package|extends|implements|instanceof)\b" 0:keyword -add-highlighter -group /java/code regex "\b(final|public|protected|private|abstract|synchronized|native|transient|volatile)\b" 0:attribute +add-highlighter shared/java/code regex %{\b(this|true|false|null)\b} 0:value +add-highlighter shared/java/code regex "\b(void|int|char|unsigned|float|boolean|double)\b" 0:type +add-highlighter shared/java/code regex "\b(while|for|if|else|do|static|switch|case|default|class|interface|enum|goto|break|continue|return|import|try|catch|throw|new|package|extends|implements|instanceof)\b" 0:keyword +add-highlighter shared/java/code regex "\b(final|public|protected|private|abstract|synchronized|native|transient|volatile)\b" 0:attribute # Commands # ‾‾‾‾‾‾‾‾ @@ -61,5 +61,5 @@ hook global WinSetOption filetype=(?!java).* %{ remove-hooks window java-hooks remove-hooks window java-indent } -hook -group java-highlight global WinSetOption filetype=java %{ add-highlighter ref java } -hook -group java-highlight global WinSetOption filetype=(?!java).* %{ remove-highlighter java } +hook -group java-highlight global WinSetOption filetype=java %{ add-highlighter window ref java } +hook -group java-highlight global WinSetOption filetype=(?!java).* %{ remove-highlighter window/java } |
