Avoid breaking follow when syncing leader's scroll position

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Kay Simmons <kay@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-12-12 15:36:30 -08:00
parent 82397f34d1
commit 9ef00ea44c
3 changed files with 32 additions and 7 deletions

View file

@ -284,17 +284,17 @@ impl Editor {
}
pub fn set_scroll_anchor(&mut self, scroll_anchor: ScrollAnchor, cx: &mut ViewContext<Self>) {
self.set_scroll_anchor_internal(scroll_anchor, true, cx);
hide_hover(self, cx);
self.scroll_manager.set_anchor(scroll_anchor, true, cx);
}
pub(crate) fn set_scroll_anchor_internal(
pub(crate) fn set_scroll_anchor_remote(
&mut self,
scroll_anchor: ScrollAnchor,
local: bool,
cx: &mut ViewContext<Self>,
) {
hide_hover(self, cx);
self.scroll_manager.set_anchor(scroll_anchor, local, cx);
self.scroll_manager.set_anchor(scroll_anchor, false, cx);
}
pub fn scroll_screen(&mut self, amount: &ScrollAmount, cx: &mut ViewContext<Self>) {