New functions: iter_graphemes_reverse(), grapheme_boundary_before()#192
Merged
New functions: iter_graphemes_reverse(), grapheme_boundary_before()#192
Conversation
late-binding or 'late-slicing' ?
As I integrate with downstream libraries, in urwid in particular, I find the to help them "move the cursor left" and look backwards from a location in a string to the previous boundary, grapheme_boundary_before(). The more obvious function, iter_graphemes_reverse() is provided, with examples
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Performance Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #192 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 618 668 +50
Branches 150 164 +14
=========================================
+ Hits 618 668 +50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4596e04 to
030cff2
Compare
030cff2 to
22f0211
Compare
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.
As I audit and integrate with dependent libraries, in urwid I find the need to help "move the cursor left" and look backwards from a location in a string to the previous boundary, while looking forward using
iter_graphemes().Looking backwards is provided by new function
grapheme_boundary_before().The more obvious function,
iter_graphemes_reverse()is provided (though not useful to urwid). @penguinolog