diff --git a/crates/editor/src/lib.rs b/crates/editor/src/lib.rs index d41fbf81cb..56f93eb5af 100644 --- a/crates/editor/src/lib.rs +++ b/crates/editor/src/lib.rs @@ -1527,10 +1527,12 @@ impl Editor { pub fn undo(&mut self, _: &Undo, cx: &mut ViewContext) { self.buffer.update(cx, |buffer, cx| buffer.undo(cx)); + self.request_autoscroll(cx); } pub fn redo(&mut self, _: &Redo, cx: &mut ViewContext) { self.buffer.update(cx, |buffer, cx| buffer.redo(cx)); + self.request_autoscroll(cx); } pub fn move_left(&mut self, _: &MoveLeft, cx: &mut ViewContext) { @@ -2344,10 +2346,8 @@ impl Editor { } if autoscroll { - self.autoscroll_requested = true; - cx.notify(); + self.request_autoscroll(cx); } - self.pause_cursor_blinking(cx); self.buffer.update(cx, |buffer, cx| { @@ -2357,6 +2357,11 @@ impl Editor { }); } + fn request_autoscroll(&mut self, cx: &mut ViewContext) { + self.autoscroll_requested = true; + cx.notify(); + } + fn start_transaction(&self, cx: &mut ViewContext) { self.buffer.update(cx, |buffer, _| { buffer