linebender / parley

Rich text layout library
Apache License 2.0
228 stars 28 forks source link

Unexpected trailing newline behavior with `Cursor` and `Selection` #132

Open xorgy opened 1 month ago

dfrg commented 1 month ago

This is a bug that originates in swash. Essentially, the Unicode line breaking algorithm generates mandatory breaks after the newline sequence so we don’t capture the final empty line at all because we don’t have a cluster where we can attach the state. I have a “fix” for this in the upcoming code that just uses the cluster’s whitespace property to detect newlines and ignores the results of the LBA entirely for these. This actually simplifies the code a bit and removes the nasty “skip mandatory break” logic.

mwcampbell commented 2 weeks ago

What's the status of this bug? Will resolving this require any significant changes to Cursor?