escape comment trailing dash only on the final chunk in speed saver#78
Open
aizu-m wants to merge 1 commit into
Open
escape comment trailing dash only on the final chunk in speed saver#78aizu-m wants to merge 1 commit into
aizu-m wants to merge 1 commit into
Conversation
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.
Saving a comment longer than 512 chars with setSaveOptimizeForSpeed(true) lost a hyphen:
The '-' at index 511 sits on a chunk boundary. OptimizedForSpeedSaver emits comment text in 512-char chunks, and entitizeAndWriteCommentText ran its trailing-dash fixup at the end of every chunk, so a lone '-' that happened to fall on a boundary was rewritten to a space even though it was in the middle of the comment. The dash state was reset per chunk too.
That fixup is only wanted at the real end of the comment, to stop the text forming '--->' with the closing delimiter. TextSaver.entitizeComment already does that in a single pass. Threaded lastWasDash across the chunks and gated the fixup on the final chunk, matching the default saver and the pi emitter next to it.