1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-24 16:15:38 +03:00

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> ] 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 ## 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> ] 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 ## 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> & ] try %[ exec -draft {b <a-k>\`\([^\n]+\n[^\n]*\'<ret> L s\`|.\'<ret> & ]
] ] ] ]
def -hidden _c-family-indent-on-opening-curly-brace %[ def -hidden _c-family-indent-on-opening-curly-brace %[