From fa9d13700abad50793d2cd81a686856646d9b6e9 Mon Sep 17 00:00:00 2001 From: Justin Frank Date: Tue, 11 Sep 2018 21:21:25 -0700 Subject: [PATCH] Added deindenting of single statements --- rc/core/c-family.kak | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index def12daa..19d9750b 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -48,6 +48,8 @@ define-command -hidden c-family-indent-on-newline %< evaluate-commands -draft -i try %< execute-keys -draft k s[a-zA-Z0-9_-]+:\h*$ j > # indent after a statement not followed by an opening brace try %< execute-keys -draft k \b(if|else|for|while)\h*\(.+?\)\h*$ j > + # deindent after a single line statement end + try %< execute-keys -draft K \;\h*$ K s\b(if|else|for|while)\h*\(.*\)\h*$|.\z 1 > # align to the opening parenthesis or opening brace (whichever is first) # on a previous line if its followed by text on the same line try %< evaluate-commands -draft %<