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
2 changes: 1 addition & 1 deletion crates/fmt/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ impl<'a, W: Write> Formatter<'a, W> {
write_chunk!(fmt, "{}", stringified.trim_start())
})?;
if !last.content.trim_start().is_empty() {
self.write_whitespace_separator(true)?;
self.indented(1, |fmt| fmt.write_whitespace_separator(true))?;
}
let last_chunk =
self.chunk_at(last.loc_before(), last.loc_next(), last.spaced, &last.content);
Expand Down
12 changes: 12 additions & 0 deletions crates/fmt/testdata/Repros/fmt.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@ function errorIdentifier() {
bytes memory error = bytes("");
if (error.length > 0) {}
}

// https://github.com/foundry-rs/foundry/issues/7549
function one() external {
this.other({
data: abi.encodeCall(
this.other,
(
"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"
)
)
});
}
12 changes: 12 additions & 0 deletions crates/fmt/testdata/Repros/original.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@ function errorIdentifier() {
bytes memory error = bytes("");
if (error.length > 0) {}
}

// https://github.com/foundry-rs/foundry/issues/7549
function one() external {
this.other({
data: abi.encodeCall(
this.other,
(
"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla"
)
)
});
}
2 changes: 1 addition & 1 deletion testdata/default/cheats/RecordAccountAccesses.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ contract RecordAccountAccessesTest is DSTest {
data: abi.encodeCall(
Create2or.create2,
(bytes32(0), abi.encodePacked(type(ConstructorStorer).creationCode, abi.encode(true)))
),
),
reverted: false,
storageAccesses: new Vm.StorageAccess[](0),
depth: 1
Expand Down