From 0aedef03334dfc0cb2a723cce23abc5b4ca55a22 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 10 Oct 2022 14:56:26 -0500 Subject: 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. --- helix-term/src/commands/lsp.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'helix-term/src/commands/lsp.rs') diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 1113b44e..726aec67 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -596,9 +596,7 @@ pub fn apply_workspace_edit( } }; - let doc = editor - .document_mut(doc_id) - .expect("Document for document_changes not found"); + let doc = doc_mut!(editor, &doc_id); // Need to determine a view for apply/append_changes_to_history let selections = doc.selections(); @@ -620,6 +618,7 @@ pub fn apply_workspace_edit( offset_encoding, ); doc.apply(&transaction, view_id); + view_mut!(editor, view_id).apply(&transaction, doc); doc.append_changes_to_history(view_id); }; -- cgit v1.2.3-70-g09d2