diff --git a/rc/filetype/c-family.kak b/rc/filetype/c-family.kak index 4d9eca73..31ad1ccc 100644 --- a/rc/filetype/c-family.kak +++ b/rc/filetype/c-family.kak @@ -98,7 +98,7 @@ 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) + # deindent closing brace(s) when after cursor 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 diff --git a/rc/filetype/go.kak b/rc/filetype/go.kak index fa81bbed..d947646f 100644 --- a/rc/filetype/go.kak +++ b/rc/filetype/go.kak @@ -89,7 +89,7 @@ define-command -hidden go-indent-on-new-line %~ try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for try %[ execute-keys -draft )MB \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] - # deindent closing brace(s) + # deindent closing brace(s) when after cursor try %[ execute-keys -draft ^\h*[})]+\h*$ ] = ~ diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index 55fd2c2b..4b393213 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -112,7 +112,7 @@ define-command -hidden rust-indent-on-new-line %~ try %+ execute-keys -draft k ^\h*where\h*$ j + # dedent after lines starting with . and ending with , or ; try %_ execute-keys -draft k ^\h*\..*[,]\h*$ j _ - # deindent closing brace(s) + # deindent closing brace(s) when after cursor try %< execute-keys -draft ^\h*[})]+\h*$ > # todo dedent additional unmatched parenthesis # try %& execute-keys -draft k s \((?:[^)(]+|\((?:[^)(]+|\([^)(]*\))*\))*\) l Gl s\) %sh{