From bcc13e151cc92e9af11ba4438499c88eff694388 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Fri, 19 Jan 2024 07:52:28 -0500 Subject: [PATCH] Change struct field name --- crates/editor/src/editor.rs | 8 ++++---- crates/editor/src/element.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 3b7b99cb82..7de6a69f11 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -367,7 +367,7 @@ pub struct Editor { project: Option>, collaboration_hub: Option>, blink_manager: Model, - recently_focused: bool, + display_cursors: bool, hovered_cursor: Option, pub show_local_selections: bool, mode: EditorMode, @@ -1613,7 +1613,7 @@ impl Editor { pixel_position_of_newest_cursor: None, gutter_width: Default::default(), style: None, - recently_focused: false, + display_cursors: false, hovered_cursor: Default::default(), editor_actions: Default::default(), show_copilot_suggestions: mode == EditorMode::Full, @@ -3904,12 +3904,12 @@ impl Editor { } fn display_cursors(&mut self, cx: &mut ViewContext) { - self.recently_focused = true; + self.display_cursors = true; cx.notify(); cx.spawn(|this, mut cx| async move { cx.background_executor().timer(Duration::from_secs(2)).await; this.update(&mut cx, |this, cx| { - this.recently_focused = false; + this.display_cursors = false; cx.notify() }) .ok() diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 2f7afe2d06..adb82b492c 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1999,7 +1999,7 @@ impl EditorElement { if Some(selection.peer_id) == editor.leader_peer_id { continue; } - let is_shown = editor.recently_focused || editor.hovered_cursor.as_ref().is_some_and(|c| c.replica_id == selection.replica_id && c.selection_id == selection.selection.id); + let is_shown = editor.display_cursors || editor.hovered_cursor.as_ref().is_some_and(|c| c.replica_id == selection.replica_id && c.selection_id == selection.selection.id); remote_selections .entry(selection.replica_id)