fix: stop emitting trailing whitespace before multi-tactic tacticSeq arguments - #14693
Open
jcreinhold wants to merge 1 commit into
Open
fix: stop emitting trailing whitespace before multi-tactic tacticSeq arguments#14693jcreinhold wants to merge 1 commit into
tacticSeq arguments#14693jcreinhold wants to merge 1 commit into
Conversation
jcreinhold
force-pushed
the
fix/pp-trailing-whitespace-sepByIndent
branch
from
August 5, 2026 19:08
d829102 to
4c8cc87
Compare
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
jcreinhold
force-pushed
the
fix/pp-trailing-whitespace-sepByIndent
branch
from
August 5, 2026 19:46
4c8cc87 to
1ec0b5f
Compare
…` arguments This PR fixes the pretty printer emitting a trailing space before a multi-tactic indented `tacticSeq` argument, as in `iterate 1␣` followed by an indented sequence, and the whitespace-only blank line produced when the separator broke at narrow widths. A multi-tactic `tacticSeq` begins with a forced `align` (a hard line break) emitted by `sepByIndent.formatter`. When a flattenable separator such as `ppSpace` precedes the sequence, the enclosing group could flatten the separator into a space even though the `align` then broke immediately, stranding the space at the end of the row. The renderer now tracks whether the current row is still fresh (no output since the last line break): a `line` immediately followed by a forced `align` that will break is broken instead of flattened, and an `align` already at its indentation level on a fresh row is a no-op rather than emitting a second, whitespace-only line.
jcreinhold
force-pushed
the
fix/pp-trailing-whitespace-sepByIndent
branch
from
August 5, 2026 21:23
1ec0b5f to
a48d2b5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the pretty printer leaving a trailing space on the row above a multi-tactic indented
tacticSeqargument, as initerate 1␣, and the whitespace-only blank line emitted instead at narrow widths.A multi-tactic
tacticSeqstarts with a forced line break (Format.align true, emitted bysepByIndent.formatter). When a breakable space (ppSpace) precedes it, the enclosing group could flatten that space even though the forced break fired immediately after it, stranding the space at the end of the row. The renderer now refuses to flatten alinewhose next output is a forcedalignthat will break, and drops thealignwhen thelinealready broke to the same column.Closes #14692