Skip to content

Commit

Permalink
formatting: Don't insert additional spacing in frozen region.
Browse files Browse the repository at this point in the history
  • Loading branch information
yTakatsukasa committed Dec 24, 2023
1 parent dd86ab0 commit 221c78d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions common/formatting/unwrapped_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,11 @@ std::ostream &FormattedExcerpt::FormattedText(
const auto &front = tokens_.front();
if (include_token_p(*front.token)) {
VLOG(2) << "action: " << front.before.action;
switch (front.before.action) {
case SpacingDecision::kAlign:
// When aligning tokens, the first token might be further indented.
stream << Spacer(front.before.spaces) << front.token->text();
break;
default:
stream << front.token->text();
if (indent && front.before.action == SpacingDecision::kAlign) {
// When aligning tokens, the first token might be further indented.
stream << Spacer(front.before.spaces) << front.token->text();
} else {
stream << front.token->text();
}
}
for (const auto &ftoken :
Expand Down

0 comments on commit 221c78d

Please sign in to comment.