Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
925 changes: 399 additions & 526 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ categories = ["command-line-utilities"]

[dependencies]
clap = { version = "4.6.1", optional = true, features = ["unicode", "derive"] }
env_logger = "0.11.10"
ignore = "0.4.25"
log = "0.4.29"
env_logger = "0.11.11"
ignore = "0.4.33"
log = "0.4.33"
nu-ansi-term = "0.50.3"
nu-cmd-lang = "0.112.2"
nu-parser = "0.112.2"
nu-protocol = "0.112.2"
nu-utils = "0.112.2"
nuon = "0.112.2"
nu-cmd-lang = "0.114.1"
nu-parser = "0.114.1"
nu-protocol = "0.114.1"
nu-utils = "0.114.1"
nuon = "0.114.1"
rayon = "1.12.0"
thiserror = "2.0.18"
thiserror = "2.0.20"

[dev-dependencies]
criterion = "0.8.2"
Expand Down
8 changes: 8 additions & 0 deletions src/formatting/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ impl<'a> Formatter<'a> {
let saved_conditional_depth = self.conditional_context_depth;
self.conditional_context_depth = 0;

// Bound inline comments at the closing brace so a trailing comment
// after `}` is not pulled inside the block (issue #199).
let saved_bound = self.inline_comment_upper_bound;
if with_braces {
self.inline_comment_upper_bound = Some(span.end.saturating_sub(1));
}

let is_simple = block.pipelines.len() == 1
&& block.pipelines[0].elements.len() == 1
&& !self.block_has_nested_structures(block)
Expand Down Expand Up @@ -419,6 +426,7 @@ impl<'a> Formatter<'a> {
self.write("}");
}

self.inline_comment_upper_bound = saved_bound;
self.conditional_context_depth = saved_conditional_depth;
}

Expand Down
Loading
Loading