Start work on updating editors's scroll positions when following

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Max Brunsfeld 2022-03-18 12:25:30 -07:00
parent 2c53175566
commit d02ab9bd06
6 changed files with 139 additions and 71 deletions

View file

@ -1033,6 +1033,14 @@ impl Editor {
self.scroll_top_anchor = Some(anchor);
}
cx.emit(Event::ScrollPositionChanged);
cx.notify();
}
fn set_scroll_top_anchor(&mut self, anchor: Anchor, cx: &mut ViewContext<Self>) {
self.scroll_position = Vector2F::zero();
self.scroll_top_anchor = Some(anchor);
cx.emit(Event::ScrollPositionChanged);
cx.notify();
}
@ -5634,6 +5642,7 @@ pub enum Event {
Saved,
TitleChanged,
SelectionsChanged,
ScrollPositionChanged,
Closed,
}