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

@ -88,7 +88,7 @@ impl FollowableItem for Editor {
}
if let Some(anchor) = state.scroll_top_anchor {
editor.set_scroll_anchor_internal(
editor.set_scroll_anchor_remote(
ScrollAnchor {
top_anchor: Anchor {
buffer_id: Some(state.buffer_id as usize),
@ -98,7 +98,6 @@ impl FollowableItem for Editor {
},
offset: vec2f(state.scroll_x, state.scroll_y),
},
false,
cx,
);
}
@ -213,7 +212,7 @@ impl FollowableItem for Editor {
self.set_selections_from_remote(selections, cx);
self.request_autoscroll_remotely(Autoscroll::newest(), cx);
} else if let Some(anchor) = message.scroll_top_anchor {
self.set_scroll_anchor(
self.set_scroll_anchor_remote(
ScrollAnchor {
top_anchor: Anchor {
buffer_id: Some(buffer_id),