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:
parent
82397f34d1
commit
9ef00ea44c
3 changed files with 32 additions and 7 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue