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

Replace use of str::Lines with unicode-bidi-based iterator #124

Merged
merged 4 commits into from
Jun 9, 2023

Conversation

tigregalis
Copy link
Contributor

Fixes #74

Alternative to #102 which this PR adapts the logic from.

The motivation for making this public is that any consumer of cosmic text that needs to construct buffers by pushing buffer lines needs to be able to split text into paragraphs, and this prevents re-implementation of this logic by every downstream consumer of cosmic text.

Usage is seamless:

+ use cosmic_text::BidiParagraphs;
-     for line in text.lines() {
+     for line in BidiParagraphs::new(&text) {

@tigregalis
Copy link
Contributor Author

I've resolved the conflict.

@tigregalis tigregalis changed the title Replace use of str::lines with unicode-bidi-based iterator Replace use of str::Lines with unicode-bidi-based iterator Jun 9, 2023
@jackpot51 jackpot51 merged commit b5f45f8 into pop-os:main Jun 9, 2023
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.

assertion failed when source text contains \r character
2 participants