Skip to content
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

Rework soft wrap to allow split priorities. #12778

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rhogenson
Copy link
Contributor

The new algorithm works by buffering the last maxwrap graphemes. When it needs to split a line, it looks for the best split within this buffer.

What I like most about this strategy is that the split_priority function can be easily overridden in the future, for example it could use the unicode line breaking algorithm to decide on possible splits, and the rest of the implementation could stay exactly the same.

Fixes #11428

The new algorithm works by buffering the last maxwrap graphemes. When
it needs to split a line, it looks for the best split within
this buffer.

What I like most about this strategy is that the split_priority
function can be easily overridden in the future, for example it could
use the unicode line breaking algorithm to decide on possible splits,
and the rest of the implementation could stay exactly the same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Soft wrapping does a line break in the middle of ".,"
1 participant