aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r--helix-term/src/ui/completion.rs7
-rw-r--r--helix-term/src/ui/editor.rs3
2 files changed, 7 insertions, 3 deletions
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs
index 2d7d4f92..c0a5da2e 100644
--- a/helix-term/src/ui/completion.rs
+++ b/helix-term/src/ui/completion.rs
@@ -143,11 +143,11 @@ impl Completion {
let (view, doc) = current!(editor);
// if more text was entered, remove it
- doc.restore(view.id);
+ doc.restore(view);
match event {
PromptEvent::Abort => {
- doc.restore(view.id);
+ doc.restore(view);
editor.last_completion = None;
}
PromptEvent::Update => {
@@ -165,6 +165,7 @@ impl Completion {
// initialize a savepoint
doc.savepoint();
doc.apply(&transaction, view.id);
+ view.apply(&transaction, doc);
editor.last_completion = Some(CompleteAction {
trigger_offset,
@@ -184,6 +185,7 @@ impl Completion {
);
doc.apply(&transaction, view.id);
+ view.apply(&transaction, doc);
editor.last_completion = Some(CompleteAction {
trigger_offset,
@@ -214,6 +216,7 @@ impl Completion {
offset_encoding, // TODO: should probably transcode in Client
);
doc.apply(&transaction, view.id);
+ view.apply(&transaction, doc);
}
}
}
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 18e1271f..3b71748b 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -988,7 +988,7 @@ impl EditorView {
InsertEvent::CompletionApply(compl) => {
let (view, doc) = current!(cxt.editor);
- doc.restore(view.id);
+ doc.restore(view);
let text = doc.text().slice(..);
let cursor = doc.selection(view.id).primary().cursor(text);
@@ -1003,6 +1003,7 @@ impl EditorView {
}),
);
doc.apply(&tx, view.id);
+ view.apply(&tx, doc);
}
InsertEvent::TriggerCompletion => {
let (_, doc) = current!(cxt.editor);