c-family.kak: indent after parenthesis at end of line

This commit is contained in:
Maxime Coste 2017-12-03 17:47:44 +08:00
parent 73a239d3be
commit 1a38849086
5 changed files with 9 additions and 2 deletions

View File

@ -39,8 +39,8 @@ 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 <a-x> <a-k>^\h+$<ret> Hd >
# indent after an opening brace
try %< execute-keys -draft k <a-x> s\{\h*$<ret> j <a-gt> >
# indent after an opening brace or parenthesis at end of line
try %< execute-keys -draft k <a-x> s[{(]\h*$<ret> j <a-gt> >
# indent after a label
try %< execute-keys -draft k <a-x> s[a-zA-Z0-9_-]+:\h*$<ret> j <a-gt> >
# indent after a statement not followed by an opening brace

View File

@ -0,0 +1 @@
c<ret>foo<esc>

View File

@ -0,0 +1 @@
foobarbaz(%( )qux

View File

@ -0,0 +1,2 @@
foobarbaz(
fooqux

View File

@ -0,0 +1,3 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/core/c-family.kak"
set buffer filetype cpp