Repository navigation
Draw one hyphen where a soft hyphen comes before a visible one [patch] - #165
Merged
Merged
Conversation
"well-known" closed the chunk "well" at the soft hyphen and then started a new chunk "-" marked as soft-hyphenated, so a break there drew "well-" over "-known". A visible hyphen arriving straight after a soft hyphen now reopens the previous chunk, so the visible hyphen ends it and the soft hyphen adds nothing: the same resolution #135 used for the opposite order. Fixes #151 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011XTgJFveY9S4CJX3Bzeyej
|
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.



Fixes #151
What changed
For
"well-known",ChunkWordclosed the chunk"well"at the soft hyphen and then started a new chunk("-", HyphenBefore: true). A break before that chunk drew the soft hyphen on the upper line and the real hyphen on the lower one, giving"well-"/"-known".A visible hyphen that arrives straight after a soft hyphen now reopens the chunk the soft hyphen closed. The visible hyphen ends that chunk, and the soft hyphen adds nothing, which is how #135 resolved the opposite order (
"-"). The issue suggested gluing the hyphen onto the previous chunk. Reopening the chunk instead also keeps a hyphen run ("well--known") in one piece under the run rules from #156/#159.Tests
NominalWordWrapDoesNotDoubleASoftHyphenFollowedByAVisibleHyphen:"a well-known"at 6 chars gives["a", "well-", "known"]. Onmainit gives["a well-", "-known"].NominalWordWrapKeepsAHyphenRunAfterASoftHyphenTogetherandNominalWordWrapDropsASoftHyphenBeforeAVisibleHyphenWhenItFitsguard the run and no-break cases. Both already pass onmain.The full suite passes: 196/196 on net10.0.
This PR is independent of #164 (#150). The two touch different functions in the same file.
🤖 Generated with Claude Code
https://claude.ai/code/session_011XTgJFveY9S4CJX3Bzeyej
Generated by Claude Code