diff options
author | Michael Davis | 2022-10-10 19:56:26 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-10-11 03:17:32 +0000 |
commit | 0aedef03334dfc0cb2a723cce23abc5b4ca55a22 (patch) | |
tree | 17e017760f23147c821bb25b0af027c47b08f10b /helix-term/src/ui/completion.rs | |
parent | d418f0795d8a33c83ad87c5530c4819d83da09ef (diff) |
Apply transactions to Views
This change adds View::apply calls for all Document::apply call-sites,
ensuring that changes to a document do not leave invalid entries in
the View's jumplist.
Diffstat (limited to 'helix-term/src/ui/completion.rs')
-rw-r--r-- | helix-term/src/ui/completion.rs | 7 |
1 files changed, 5 insertions, 2 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); } } } |