Rust align open paren for if and for
This commit is contained in:
parent
dd1a582b30
commit
11d98a07dc
|
@ -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 <a-F> ) M <a-k> \A\(.*\)\h*\n\h*\{\z <ret> s \A|.\z <ret> 1<a-&> ]
|
||||
# dedent standalone { after impl and related block without any { in between
|
||||
try %< execute-keys -draft hh <a-?> impl|fn|struct|enum|union <ret> <a-K> \{ <ret> <a-semicolon> <semicolon> ll <a-x> <a-k> ^\h*\{$ <ret> <a-lt> >
|
||||
try %< execute-keys -draft hh <a-?> impl|fn|struct|enum|union|if|for <ret> <a-K> \{ <ret> <a-semicolon> <semicolon> ll <a-x> <a-k> ^\h*\{$ <ret> <a-lt> >
|
||||
_
|
||||
]
|
||||
|
||||
|
|
|
@ -33,3 +33,12 @@
|
|||
|
||||
union X<T> where T: Debug %( )
|
||||
|
||||
if foo()
|
||||
&& bar()
|
||||
%( )
|
||||
|
||||
for x in group
|
||||
.iter()
|
||||
.sorted_by(|a, b| Ord::cmp(&a.0, &b.0))
|
||||
%( )
|
||||
|
||||
|
|
|
@ -33,3 +33,12 @@
|
|||
|
||||
union X<T> where T: Debug {
|
||||
|
||||
if foo()
|
||||
&& bar()
|
||||
{
|
||||
|
||||
for x in group
|
||||
.iter()
|
||||
.sorted_by(|a, b| Ord::cmp(&a.0, &b.0))
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user