mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-31 12:37:45 +00:00
feat: root without max-width
This commit is contained in:
parent
6d47a4b680
commit
1dd2d0c7cb
1 changed files with 11 additions and 5 deletions
|
@ -4,18 +4,24 @@ pub fn rule(
|
|||
) -> std::collections::LinkedList<crate::builder::Step> {
|
||||
let mut steps = std::collections::LinkedList::new();
|
||||
|
||||
let mut children = crate::children::Children::new(build_ctx, node);
|
||||
let mut children = crate::children::Children::new_with_configuration(
|
||||
build_ctx, node, true,
|
||||
);
|
||||
|
||||
let layout = if children.has_comments() {
|
||||
let layout = if children.has_comments() || children.has_newlines() {
|
||||
&crate::config::Layout::Tall
|
||||
} else {
|
||||
build_ctx.config.layout()
|
||||
};
|
||||
|
||||
while children.has_next() {
|
||||
children.drain_comments(|text| {
|
||||
steps.push_back(crate::builder::Step::Comment(text));
|
||||
steps.push_back(crate::builder::Step::NewLine);
|
||||
children.drain_comments_and_newlines(|element| match element {
|
||||
crate::children::DrainCommentOrNewline::Comment(text) => {
|
||||
steps.push_back(crate::builder::Step::Comment(text));
|
||||
steps.push_back(crate::builder::Step::NewLine);
|
||||
steps.push_back(crate::builder::Step::Pad);
|
||||
}
|
||||
crate::children::DrainCommentOrNewline::Newline(_) => {}
|
||||
});
|
||||
|
||||
if let Some(child) = children.get_next() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue