From 8f08375a1b4cf247ac2f46519dec43796d9094fe Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 22 Nov 2022 20:37:48 -0600 Subject: [PATCH] Leave TODOs for cleaning up View::apply --- helix-view/src/lib.rs | 8 +++----- helix-view/src/view.rs | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/helix-view/src/lib.rs b/helix-view/src/lib.rs index 4c32b356b9ea..9cf36ae0505c 100644 --- a/helix-view/src/lib.rs +++ b/helix-view/src/lib.rs @@ -71,12 +71,10 @@ pub fn align_view(doc: &Document, view: &mut View, align: Align) { pub fn apply_transaction( transaction: &helix_core::Transaction, doc: &mut Document, - view: &mut View, + view: &View, ) -> bool { - // This is a short function but it's easy to call `Document::apply` - // without calling `View::apply` or in the wrong order. The transaction - // must be applied to the document before the view. - doc.apply(transaction, view.id) && view.apply(transaction, doc) + // TODO remove this helper function. Just call Document::apply everywhere directly. + doc.apply(transaction, view.id) } pub use document::Document; diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index 6da4df1f0f03..21d742b45dea 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -345,6 +345,7 @@ impl View { /// which applies a transaction to the [`Document`] and view together. pub fn apply(&mut self, transaction: &Transaction, doc: &Document) -> bool { self.jumps.apply(transaction, doc); + // TODO: remove the boolean return. This is unused. true } }