Skip to content

Commit

Permalink
Leave TODOs for cleaning up View::apply
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Nov 23, 2022
1 parent f650ce0 commit 8f08375
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions helix-view/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions helix-view/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 8f08375

Please sign in to comment.