Skip to content

Conversation

lihaoyi
Copy link
Contributor

@lihaoyi lihaoyi commented Oct 1, 2025

Previously the initial val res0: Seq[Int] = was not considered, so the pretty-printed value when appended to it could over-run the 100-column limit of the REPL. This PR properly takes the last line of the prefix (which can have multiple lines) and passes it to PPrinter.apply's initialOffset so the first line considers the prefix and wraps earlier as necessary

Tested manually with Seq.tabulate(22)(identity). The single-line output (below) is 104 characters, exceeding the 100 char default limit. With this PR, it properly wraps, while without this PR it doesn't, and you instead need to go all the way up to Seq.tabulate(27)(identity) for it to wrap

val res0: Seq[Int] = List(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)

Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Oct 8, 2025

@tgodzik not sure if you need to do anything when merging, but last PR you merged you didn't squash it (8ac4db2) so do remember to move the dropdown from Merge to Squash and Merge and make sure the merge message is the PR description (should be automatic but need to make sure)

@tgodzik
Copy link
Contributor

tgodzik commented Oct 8, 2025

@tgodzik not sure if you need to do anything when merging, but last PR you merged you didn't squash it (8ac4db2) so do remember to move the dropdown from Merge to Squash and Merge and make sure the merge message is the PR description (should be automatic but need to make sure)

Och damn, I was sure I was doing squash. Sorry about that

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tgodzik tgodzik merged commit 7bf6b7d into scala:main Oct 8, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants