-
Notifications
You must be signed in to change notification settings - Fork 323
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
New Text.insert function #3311
New Text.insert function #3311
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good general shape, but the current implementation seems to insert at codepoint positions whereas we use grapheme-cluster based indexing everywhere.
Great that there are tests for edge cases like inserting at the end of the string and just after it. But some more tests should be added to test the behaviour in presence of grapheme clusters that consist of multiple codepoints.
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Text/Extensions.enso
Outdated
Show resolved
Hide resolved
Deal with grapheme cluster bounderies correctly. Updated docs.
80eec62
to
0d2b1b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a few very minor comments.
Co-authored-by: Radosław Waśko <[email protected]>
Addressed the remaining PR review comments
Pull Request Description
The change adds
Text.insert
function to allow for adding a section of text into another at a specified position.Implements https://www.pivotaltracker.com/n/projects/2539304.
Checklist
Please include the following checklist in your PR:
./run dist
and./run watch
.