1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-08-01 21:17:45 +00:00

feat: do not indent second bin op

This commit is contained in:
Kevin Amado 2022-01-31 20:48:27 -05:00
parent af6c62da14
commit b61724a5a4
No known key found for this signature in database
GPG key ID: FFF341057F503148
3 changed files with 58 additions and 61 deletions

View file

@ -18,12 +18,10 @@ pub fn rule(
crate::config::Layout::Tall => match child.element.kind() { crate::config::Layout::Tall => match child.element.kind() {
rnix::SyntaxKind::NODE_SELECT => { rnix::SyntaxKind::NODE_SELECT => {
steps.push_back(crate::builder::Step::Format(child.element)); steps.push_back(crate::builder::Step::Format(child.element));
steps.push_back(crate::builder::Step::Indent);
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::Indent);
steps.push_back(crate::builder::Step::FormatWider( steps.push_back(crate::builder::Step::FormatWider(
child.element, child.element,
)); ));
@ -66,7 +64,6 @@ pub fn rule(
match layout { match layout {
crate::config::Layout::Tall => { crate::config::Layout::Tall => {
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::Format(child.element)); steps.push_back(crate::builder::Step::Format(child.element));

View file

@ -1,5 +1,5 @@
a a
.${ .${
/* /*
b b
*/ */
@ -13,4 +13,4 @@ a
/* /*
g g
*/ */
} }