Expose trimed whitespace#205
Merged
Merged
Conversation
benoitkugler
requested review from
andydotxyz and
whereswaldon
as code owners
December 8, 2025 15:04
…ting into expose-trimed-whitespace
whereswaldon
approved these changes
Dec 8, 2025
whereswaldon
left a comment
Member
There was a problem hiding this comment.
Seems like a reasonable feature to me! Implementation is solid too. Thanks for the test!
andydotxyz
approved these changes
Dec 23, 2025
benoitkugler
added a commit
that referenced
this pull request
Dec 23, 2025
* [shaping] expose the space we trim when wrapping with TrimWhiteSpace enabled * minor typos * Replace setup-go-faster action with setup-go * Replace setup-go-faster action with setup-go * [shaping] expose the space we trim when wrapping with TrimWhiteSpace enabled * minor typos * remove debug fmt.Println
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.
When using
go-textto wrap text ending with spaces, I want to put the final space on the first line when it fits (speaking about the advance). This requirement is somewhere betweenDisableTrailingWhitespaceTrim=trueandDisableTrailingWhitespaceTrim=false: disabling trimming will miss wrapping opportunities, enabling it will always remove the space advance even when it could fit.The workaround I've found is to to enable trimming, but to check after if the advance including the space would have fit.
The cleanest way to do so seems to expose the actual advance that was trimmed: that is implemented in this PR.