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 %<