aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorMatthias Deiml2022-08-04 05:44:43 +0000
committerGitHub2022-08-04 05:44:43 +0000
commit0ee20611022b5a7bec727d2159ec7c6b36e956b6 (patch)
treec6140d3657184c19dc4a2a8bef47a643b4c247a8 /helix-term/src/commands
parentafd292e3b9616ea9098ca3a7d24a730508b84809 (diff)
Avoid copying fragments (#3136)
* Avoid copying fragments * Add slice / slices method * Better documentation for fragment and slice methods
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index f6eedea9..dbf7cb24 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1291,8 +1291,8 @@ fn sort_impl(
let selection = doc.selection(view.id);
let mut fragments: Vec<_> = selection
- .fragments(text)
- .map(|fragment| Tendril::from(fragment.as_ref()))
+ .slices(text)
+ .map(|fragment| fragment.chunks().collect())
.collect();
fragments.sort_by(match reverse {