From 21614cb06ea4f7a7349c628e5b8a754f730b2f0d Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 22 Oct 2019 11:02:06 +0200 Subject: src: Create a named key This commit allows using the expansion in commands, instead of `\;`. It makes commands look more elegant, and prevents new-comers from falling into the trap of using without escaping the semicolon. --- rc/filetype/java.kak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rc/filetype/java.kak') diff --git a/rc/filetype/java.kak b/rc/filetype/java.kak index 9db24740..829652c4 100644 --- a/rc/filetype/java.kak +++ b/rc/filetype/java.kak @@ -43,7 +43,7 @@ add-highlighter shared/java/code/ regex "(? } + try %{ execute-keys -draft K } # indent after lines ending with { or ( try %[ execute-keys -draft k [{(]\h*$ j ] # cleanup trailing white spaces on the previous line @@ -51,11 +51,11 @@ define-command -hidden java-indent-on-new-line %~ # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } # copy // comments prefix - try %{ execute-keys -draft \;k s ^\h*\K/{2,} yP } + try %{ execute-keys -draft k s ^\h*\K/{2,} yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after keywords - try %[ execute-keys -draft \;)MB \A(if|else|while|for|try|catch)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] + try %[ execute-keys -draft )MB \A(if|else|while|for|try|catch)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] = ~ -- cgit v1.2.3