From 8c64c3dfa3be911344ae0acaeee8018ffccde643 Mon Sep 17 00:00:00 2001 From: Mathis Brossier Date: Mon, 20 Jun 2022 20:41:34 +0200 Subject: [PATCH] mouse selection now uses character indexing (#2839) --- helix-term/src/ui/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index f074d9f1c..192fa1804 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1046,7 +1046,7 @@ impl EditorView { let mut selection = doc.selection(view.id).clone(); let primary = selection.primary_mut(); - *primary = Range::new(primary.anchor, pos); + *primary = primary.put_cursor(doc.text().slice(..), pos, true); doc.set_selection(view.id, selection); EventResult::Consumed(None) }