mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 12:37:45 +00:00
fix: stable let in
- I was using the previous position to compute the new position, but this causes the let in to not converge into a single round - This way let in converge into a single round, as promised in the README
This commit is contained in:
parent
c5856f7625
commit
50b2edb882
2 changed files with 7 additions and 4 deletions
|
@ -20,9 +20,12 @@ impl Children {
|
|||
|
||||
for child in node.children_with_tokens() {
|
||||
match child {
|
||||
rnix::SyntaxElement::Node(_) => {
|
||||
children
|
||||
.push(Child { element: child, pos: pos.clone() });
|
||||
rnix::SyntaxElement::Node(node) => {
|
||||
children.push(Child {
|
||||
element: node.clone().into(),
|
||||
pos: pos.clone(),
|
||||
});
|
||||
pos.update(&node.text().to_string());
|
||||
}
|
||||
rnix::SyntaxElement::Token(token) => {
|
||||
match token.kind() {
|
||||
|
|
|
@ -82,7 +82,7 @@ pub fn rule(
|
|||
|
||||
// in
|
||||
let child = children.get_next().unwrap();
|
||||
let indent = child.pos.column > 1;
|
||||
let indent = build_ctx.pos_new.column > 1;
|
||||
match layout {
|
||||
crate::config::Layout::Tall => {
|
||||
steps.push_back(crate::builder::Step::Dedent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue