From 8c64c3dfa3be911344ae0acaeee8018ffccde643 Mon Sep 17 00:00:00 2001 From: Mathis Brossier Date: Mon, 20 Jun 2022 20:41:34 +0200 Subject: mouse selection now uses character indexing (#2839) --- helix-term/src/ui/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-term') diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index f074d9f1..192fa180 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) } -- cgit v1.2.3-70-g09d2