summaryrefslogtreecommitdiff
path: root/rc/filetype/rust.kak
diff options
context:
space:
mode:
authorIvan Tham <pickfire@riseup.net>2021-02-17 01:16:58 +0800
committerIvan Tham <pickfire@riseup.net>2021-02-17 01:17:17 +0800
commit4e594e034adf3f3c005dbd2c020063c64e351d52 (patch)
tree753ee04948af5c046175514e0df82f04332e58b4 /rc/filetype/rust.kak
parent049591f6b494efb969f36b553e4dfe14ce1cddce (diff)
Dedent rust await function with ?
Diffstat (limited to 'rc/filetype/rust.kak')
-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