1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-08-01 04:57:44 +00:00

feat: indent let bindings

This commit is contained in:
Kevin Amado 2022-01-30 18:25:18 -05:00
parent 7cd1bd2763
commit 4a23885541
No known key found for this signature in database
GPG key ID: FFF341057F503148
2 changed files with 28 additions and 21 deletions

View file

@ -81,6 +81,12 @@ pub fn rule(
} }
} }
steps.push_back(crate::builder::Step::Format(child.element)); steps.push_back(crate::builder::Step::Format(child.element));
match layout {
crate::config::Layout::Tall => {
steps.push_back(crate::builder::Step::Indent);
}
crate::config::Layout::Wide => {}
}
// /**/ // /**/
children.drain_comments(|text| { children.drain_comments(|text| {
@ -96,6 +102,7 @@ pub fn rule(
steps.push_back(crate::builder::Step::NewLine); steps.push_back(crate::builder::Step::NewLine);
steps.push_back(crate::builder::Step::Pad); steps.push_back(crate::builder::Step::Pad);
steps.push_back(crate::builder::Step::FormatWider(child.element)); steps.push_back(crate::builder::Step::FormatWider(child.element));
steps.push_back(crate::builder::Step::Dedent);
} }
crate::config::Layout::Wide => { crate::config::Layout::Wide => {
steps.push_back(crate::builder::Step::Whitespace); steps.push_back(crate::builder::Step::Whitespace);

View file

@ -6,10 +6,10 @@ let
let let
c = 1; c = 1;
in in
/* /*
e e
*/ */
f; f;
/**/ /**/
a = a =
let let
@ -18,7 +18,7 @@ let
d d
*/ */
in in
f; f;
/**/ /**/
a = a =
let let
@ -27,10 +27,10 @@ let
d d
*/ */
in in
/* /*
e e
*/ */
f; f;
/**/ /**/
a = a =
let let
@ -39,7 +39,7 @@ let
*/ */
c = 1; c = 1;
in in
f; f;
/**/ /**/
a = a =
let let
@ -48,10 +48,10 @@ let
*/ */
c = 1; c = 1;
in in
/* /*
e e
*/ */
f; f;
/**/ /**/
a = a =
let let
@ -63,7 +63,7 @@ let
d d
*/ */
in in
f; f;
/**/ /**/
a = a =
let let
@ -75,11 +75,11 @@ let
d d
*/ */
in in
/* /*
e e
*/ */
f; f;
/**/ /**/
in in
/**/ /**/
a a