Skip to content

Commit 8f08375

Browse files
committed
Leave TODOs for cleaning up View::apply
1 parent f650ce0 commit 8f08375

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

helix-view/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ pub fn align_view(doc: &Document, view: &mut View, align: Align) {
7171
pub fn apply_transaction(
7272
transaction: &helix_core::Transaction,
7373
doc: &mut Document,
74-
view: &mut View,
74+
view: &View,
7575
) -> bool {
76-
// This is a short function but it's easy to call `Document::apply`
77-
// without calling `View::apply` or in the wrong order. The transaction
78-
// must be applied to the document before the view.
79-
doc.apply(transaction, view.id) && view.apply(transaction, doc)
76+
// TODO remove this helper function. Just call Document::apply everywhere directly.
77+
doc.apply(transaction, view.id)
8078
}
8179

8280
pub use document::Document;

helix-view/src/view.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ impl View {
345345
/// which applies a transaction to the [`Document`] and view together.
346346
pub fn apply(&mut self, transaction: &Transaction, doc: &Document) -> bool {
347347
self.jumps.apply(transaction, doc);
348+
// TODO: remove the boolean return. This is unused.
348349
true
349350
}
350351
}

0 commit comments

Comments
 (0)