From f185aca25a0d370b8812d82ffeec903da1178c87 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 24 Jan 2024 19:10:53 -0700 Subject: [PATCH] Use the correct snapshot when calculating mouse positions --- crates/editor/src/element.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 65d2e06d35..bcf2504d34 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -567,7 +567,7 @@ impl EditorElement { cx, ); hover_at(editor, Some(point), cx); - Self::update_visible_cursor(editor, point, cx); + Self::update_visible_cursor(editor, point, position_map, cx); } None => { update_inlay_link_and_hover_points( @@ -592,9 +592,10 @@ impl EditorElement { fn update_visible_cursor( editor: &mut Editor, point: DisplayPoint, + position_map: &PositionMap, cx: &mut ViewContext, ) { - let snapshot = editor.snapshot(cx); + let snapshot = &position_map.snapshot; let Some(hub) = editor.collaboration_hub() else { return; };