Tweak c-family indent logic

This commit is contained in:
Maxime Coste 2016-09-05 13:55:03 +01:00
parent 21a76d135c
commit e9c63316f5

View File

@ -57,8 +57,8 @@ def -hidden _c-family-indent-on-newline %[ eval -draft -itersel %[
try %[ exec -draft K <a-x> s[a-zA-Z0-9_-]+:\h*$<ret> j <a-gt> ]
## indent after a statement not followed by an opening brace
try %[ exec -draft k <a-x> <a-k>\b(if|else|for|while)\h*\(.+?\)\h*$<ret> j <a-gt> ]
## align to the opening parenthesis on the previous line when inserting a newline
try %[ exec -draft {b <a-k>\`\([^\n]*\n[^\n]*\'<ret> L s\`|.\'<ret> & ]
## align to the opening parenthesis on a previous line if its followed by text on the same line
try %[ exec -draft {b <a-k>\`\([^\n]+\n[^\n]*\'<ret> L s\`|.\'<ret> & ]
] ]
def -hidden _c-family-indent-on-opening-curly-brace %[