From 4b35a701c4e10e45c182eae9e1bf5868cd34ad8f Mon Sep 17 00:00:00 2001 From: John Isom Date: Sun, 26 Jul 2020 18:56:53 -0600 Subject: [PATCH] Fix indentation rule for c-family.kak --- rc/filetype/c-family.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/filetype/c-family.kak b/rc/filetype/c-family.kak index 837c5059..4d9eca73 100644 --- a/rc/filetype/c-family.kak +++ b/rc/filetype/c-family.kak @@ -83,7 +83,7 @@ define-command -hidden c-family-indent-on-newline %< evaluate-commands -draft -i # remove previous empty lines resulting from the automatic indent try %< execute-keys -draft k ^\h+$ Hd > # indent after an opening brace or parenthesis at end of line - try %< execute-keys -draft k s[{(]\h*$ j > + try %< execute-keys -draft k [{(]\h*$ j > # 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 @@ -98,6 +98,8 @@ define-command -hidden c-family-indent-on-newline %< evaluate-commands -draft -i try %< execute-keys -draft K \;\h*(//[^\n]+)?$ \ K s \belse\b\h*(?://[^\n]+)?\n([^\n]*\n){2}\z \ 1 > + # deindent closing brace(s) + try %< execute-keys -draft ^\h*[})]+\h*$ > # 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 %<