forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consistently replace line-endings in paste/replace commands
Previously we replaced line-endings in pasted text to the document line-ending for some values in paste commands. We missed the `repeat` values in paste though and didn't do any replacement in the replace command. Along with this change I've refactored the replace command to avoid intermediary collections. We previously eagerly collected the values from the input register as a `Vec<String>` but we can avoid both of those conversions and only allocate for the conversion to a `Tendril`. We can also switch from `str::repeat` to a manual implementation to avoid the intermediary conversion to a String - this avoids an extra allocation in the common case (i.e. no count). Fixes helix-editor#12329
- Loading branch information
1 parent
f0dc797
commit e36a9c9
Showing
1 changed file
with
35 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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