diff --git a/rc/filetype/rust.kak b/rc/filetype/rust.kak index d7ff4952..a06ae7d1 100644 --- a/rc/filetype/rust.kak +++ b/rc/filetype/rust.kak @@ -174,7 +174,7 @@ define-command -hidden rust-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren try %[ execute-keys -draft h ) M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] # dedent standalone { after impl and related block without any { in between - try %< execute-keys -draft hh impl|fn|struct|enum|union \{ ll ^\h*\{$ > + try %< execute-keys -draft hh impl|fn|struct|enum|union|if|for \{ ll ^\h*\{$ > _ ] diff --git a/test/indent/rust/on-open-paren/in b/test/indent/rust/on-open-paren/in index 1ca71d62..661f2331 100644 --- a/test/indent/rust/on-open-paren/in +++ b/test/indent/rust/on-open-paren/in @@ -33,3 +33,12 @@ union X where T: Debug %( ) + if foo() + && bar() + %( ) + + for x in group + .iter() + .sorted_by(|a, b| Ord::cmp(&a.0, &b.0)) + %( ) + diff --git a/test/indent/rust/on-open-paren/out b/test/indent/rust/on-open-paren/out index de125ea7..60973f8a 100644 --- a/test/indent/rust/on-open-paren/out +++ b/test/indent/rust/on-open-paren/out @@ -33,3 +33,12 @@ union X where T: Debug { + if foo() + && bar() + { + + for x in group + .iter() + .sorted_by(|a, b| Ord::cmp(&a.0, &b.0)) + { +