aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
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/ui
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/ui')
-rw-r--r--helix-term/src/ui/editor.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index f5598095..d99f1a4e 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -1029,8 +1029,8 @@ impl EditorView {
if doc
.selection(view.id)
.primary()
- .fragment(doc.text().slice(..))
- .width()
+ .slice(doc.text().slice(..))
+ .len_chars()
<= 1
{
return EventResult::Ignored(None);