Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 36cb295c..00aa7390 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -1,6 +1,6 @@
use arc_swap::{access::Map, ArcSwap};
use futures_util::Stream;
-use helix_core::{diagnostic::Severity, pos_at_coords, syntax, Selection};
+use helix_core::{diagnostic::Severity, pos_at_coords, syntax, Range, Selection};
use helix_lsp::{
lsp::{self, notification::Notification},
util::lsp_range_to_range,
@@ -210,8 +210,13 @@ impl Application {
// opened last is focused on.
let view_id = editor.tree.focus;
let doc = doc_mut!(editor, &doc_id);
- let pos = Selection::point(pos_at_coords(doc.text().slice(..), pos, true));
- doc.set_selection(view_id, pos);
+ let selection = pos
+ .into_iter()
+ .map(|coords| {
+ Range::point(pos_at_coords(doc.text().slice(..), coords, true))
+ })
+ .collect();
+ doc.set_selection(view_id, selection);
}
}