From 3a24763d532f86d38867278229634cd93ddde8a2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 9 Aug 2016 18:45:13 +0100 Subject: [PATCH] c-indent: only align to opening paren if it is on the immediate previous line --- rc/core/c-family.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index c5859c3a..9904bc29 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -57,8 +57,8 @@ def -hidden _c-family-indent-on-newline %[ eval -draft -itersel %[ try %[ exec -draft K s[a-zA-Z0-9_-]+:\h*$ j ] ## indent after a statement not followed by an opening brace try %[ exec -draft k \b(if|else|for|while)\h*\(.+?\)\h*$ j ] - ## align to the opening parenthesis when inserting a newline - try %[ exec -draft {b \`\( L s\`|.\' & ] + ## align to the opening parenthesis on the previous line when inserting a newline + try %[ exec -draft {b \`\([^\n]*\n[^\n]*\' L s\`|.\' & ] ] ] def -hidden _c-family-indent-on-opening-curly-brace %[