-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
trim whitespace from EOLs when line split is found #395
Conversation
@@ -1328,6 +1328,9 @@ public TextLine SplitAt(LineBreak lineBreak, bool keepAll) | |||
|
|||
if (index == 0) | |||
{ | |||
// Now trim trailing whitespace from this line in the case of an exact | |||
// length line break (non CJK) | |||
this.TrimTrailingWhitespaceAndRecalculateMetrics(); |
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.
I found that in case of exact length line breaks, there could be whitespace that remains untrimmed - the addition of this line here would take care of that (without losing the benefits of the fix added for issue 367)
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.
This all looks great. Thanks for the contribution!
EDIT.
Looks like the tests still fail?
Yeah, I had missed one final spot above where whitespace needed the extra trimming! |
Prerequisites
Description
In
SplitAt
, when aTextLine
is split at exact length match - the loop will no longer grab and trim the whitespace on the next iteration because it exits early (Issue 367 fix). Instead, added a whitespace trim inSplitAt
when the exact length match is being examined.See Issue 393 for a visual representation. More detail can be provided upon request.