aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 7d86bc0b..8d70cd9e 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -33,7 +33,7 @@ use helix_core::{
use helix_view::{
clipboard::ClipboardType,
document::{FormatterError, Mode, SCRATCH_BUFFER_NAME},
- editor::{Action, Motion},
+ editor::{Action, CompleteAction, Motion},
info::Info,
input::KeyEvent,
keyboard::KeyCode,
@@ -4254,7 +4254,12 @@ pub fn completion(cx: &mut Context) {
iter.reverse();
let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count();
let start_offset = cursor.saturating_sub(offset);
- let savepoint = doc.savepoint(view);
+ let savepoint = if let Some(CompleteAction::Selected { savepoint }) = &cx.editor.last_completion
+ {
+ savepoint.clone()
+ } else {
+ doc.savepoint(view)
+ };
let trigger_doc = doc.id();
let trigger_view = view.id;