Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/handlers/completion.rs')
-rw-r--r--helix-term/src/handlers/completion.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-term/src/handlers/completion.rs b/helix-term/src/handlers/completion.rs
index f3223487..3b12bd0a 100644
--- a/helix-term/src/handlers/completion.rs
+++ b/helix-term/src/handlers/completion.rs
@@ -184,7 +184,8 @@ fn request_completion(
}
let text = doc.text();
- let cursor = doc.selection(view.id).primary().cursor(text.slice(..));
+ let selection = doc.selection(view.id);
+ let cursor = selection.primary().cursor(text.slice(..));
if trigger.view != view.id || trigger.doc != doc.id() || cursor < trigger.pos {
return;
}
@@ -265,7 +266,7 @@ fn request_completion(
}
.boxed()
})
- .chain(path_completion(cursor, text.clone(), doc, handle.clone()))
+ .chain(path_completion(selection.clone(), doc, handle.clone()))
.collect();
let future = async move {