summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
Diffstat (limited to 'rc')
-rw-r--r--rc/filetype/rust.kak4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak
index 1267f52a..473a2e89 100644
--- a/rc/filetype/rust.kak
+++ b/rc/filetype/rust.kak
@@ -157,8 +157,8 @@ define-command -hidden rust-indent-on-new-line %~
try %< execute-keys -draft k <a-x> s [^\h].+ <ret> <a-K> \A[-+*/&|^})<gt><lt>#] <ret> <a-K> [,<semicolon>{](\h*/[/*].*|)$ <ret> j <a-gt> >
# indent after lines ending with {
try %< execute-keys -draft k <a-x> <a-k> \{$ <ret> j <a-gt> >
- # dedent after lines starting with . and ending with } or ) or , or ; or .await
- try %_ execute-keys -draft k <a-x> <a-k> ^\h*\. <ret> <a-k>([}),<semicolon>]|\.await)\h*$ <ret> j <a-lt> _
+ # dedent after lines starting with . and ending with } or ) or , or ; or .await (} or ) or .await maybe with ?)
+ try %_ execute-keys -draft k <a-x> <a-k> ^\h*\. <ret> <a-k> ([,<semicolon>]|(([})]|\.await)\?*))\h*$ <ret> j <a-lt> _
# dedent after lines ending with " => {}" - part of empty match
try %# execute-keys -draft k <a-x> <a-k> \ =>\ \{\}\h*$ <ret> j <a-lt> #
# align to opening curly brace or paren when newline is inserted before a single closing