-
Notifications
You must be signed in to change notification settings - Fork 18
Expose trimed whitespace #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ting into expose-trimed-whitespace
whereswaldon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a reasonable feature to me! Implementation is solid too. Thanks for the test!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great :)
Looks like there is a conflict with other items recently merged :(
* [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
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.