diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 71eb94a9..55e08c6a 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -47,9 +47,9 @@ define-command -hidden c-family-indent-on-newline %< evaluate-commands -draft -i # indent after a label 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 > + 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 > + 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 %<