mouse selection now uses character indexing (#2839)

This commit is contained in:
Mathis Brossier 2022-06-20 20:41:34 +02:00 committed by GitHub
parent cad4e03a00
commit 8c64c3dfa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
}