@@ -751,19 +751,35 @@ impl Document {
753 /// Undo modifications to the [`Document`] according to `uk`.
753 /// Undo modifications to the [`Document`] according to `uk`.
754− pub fn earlier(&mut self, view_id: ViewId, uk: helix_core::history::UndoKind) {
754+ pub fn earlier(&mut self, view_id: ViewId, uk: helix_core::history::UndoKind) -> bool {
755 let txns = self.history.get_mut().earlier(uk);
755 let txns = self.history.get_mut().earlier(uk);
756+ let mut success = false;
756 for txn in txns {
757 for txn in txns {
757− self.apply_impl(&txn, view_id);
758+ if self.apply_impl(&txn, view_id) {
763+ // reset changeset to fix len
764+ self.changes = ChangeSet::new(self.text());
761 /// Redo modifications to the [`Document`] according to `uk`.
769 /// Redo modifications to the [`Document`] according to `uk`.
762− pub fn later(&mut self, view_id: ViewId, uk: helix_core::history::UndoKind) {
770+ pub fn later(&mut self, view_id: ViewId, uk: helix_core::history::UndoKind) -> bool {
763 let txns = self.history.get_mut().later(uk);
771 let txns = self.history.get_mut().later(uk);
772+ let mut success = false;
764 for txn in txns {
773 for txn in txns {
765− self.apply_impl(&txn, view_id);
774+ if self.apply_impl(&txn, view_id) {
779+ // reset changeset to fix len
780+ self.changes = ChangeSet::new(self.text());
769 /// Commit pending changes to history
785 /// Commit pending changes to history