@@ -857,11 +857,11 @@ impl Document {
860− fn undo_redo_impl(&mut self, view: &mut View, undo: bool) -> bool {
860+ fn undo_redo_impl(&mut self, view_id: ViewId, undo: bool) -> bool {
861 let mut history = self.history.take();
861 let mut history = self.history.take();
862 let txn = if undo { history.undo() } else { history.redo() };
862 let txn = if undo { history.undo() } else { history.redo() };
863 let success = if let Some(txn) = txn {
863 let success = if let Some(txn) = txn {
864− self.apply_impl(txn, view.id) && view.apply(txn, self)
864+ self.apply_impl(txn, view_id)
@@ -875,13 +875,13 @@ impl Document {
877 /// Undo the last modification to the [`Document`]. Returns whether the undo was successful.
877 /// Undo the last modification to the [`Document`]. Returns whether the undo was successful.
878− pub fn undo(&mut self, view: &mut View) -> bool {
878+ pub fn undo(&mut self, view_id: ViewId) -> bool {
879− self.undo_redo_impl(view, true)
879+ self.undo_redo_impl(view_id, true)
882 /// Redo the last modification to the [`Document`]. Returns whether the redo was successful.
882 /// Redo the last modification to the [`Document`]. Returns whether the redo was successful.
883− pub fn redo(&mut self, view: &mut View) -> bool {
883+ pub fn redo(&mut self, view_id: ViewId) -> bool {
884− self.undo_redo_impl(view, false)
884+ self.undo_redo_impl(view_id, false)
887 pub fn savepoint(&mut self) {
887 pub fn savepoint(&mut self) {
@@ -894,7 +894,7 @@ impl Document {
897− fn earlier_later_impl(&mut self, view: &mut View, uk: UndoKind, earlier: bool) -> bool {
897+ fn earlier_later_impl(&mut self, view_id: ViewId, uk: UndoKind, earlier: bool) -> bool {
898 let txns = if earlier {
898 let txns = if earlier {
899 self.history.get_mut().earlier(uk)
899 self.history.get_mut().earlier(uk)
@@ -902,7 +902,7 @@ impl Document {
903 let mut success = false;
903 let mut success = false;
904 for txn in txns {
904 for txn in txns {
905− if self.apply_impl(&txn, view.id) && view.apply(&txn, self) {
905+ if self.apply_impl(&txn, view_id) {
906 success = true;
906 success = true;
@@ -914,13 +914,13 @@ impl Document {
916 /// Undo modifications to the [`Document`] according to `uk`.
916 /// Undo modifications to the [`Document`] according to `uk`.
917− pub fn earlier(&mut self, view: &mut View, uk: UndoKind) -> bool {
917+ pub fn earlier(&mut self, view_id: ViewId, uk: UndoKind) -> bool {
918− self.earlier_later_impl(view, uk, true)
918+ self.earlier_later_impl(view_id, uk, true)
921 /// Redo modifications to the [`Document`] according to `uk`.
921 /// Redo modifications to the [`Document`] according to `uk`.
922− pub fn later(&mut self, view: &mut View, uk: UndoKind) -> bool {
922+ pub fn later(&mut self, view_id: ViewId, uk: UndoKind) -> bool {
923− self.earlier_later_impl(view, uk, false)
923+ self.earlier_later_impl(view_id, uk, false)
926 /// Commit pending changes to history
926 /// Commit pending changes to history