Rename show cursors
to display cursor names
(#4162)
Release Notes: - N/A
This commit is contained in:
commit
ce5adc7cde
4 changed files with 12 additions and 12 deletions
|
@ -350,7 +350,7 @@
|
||||||
"ctrl-space": "editor::ShowCompletions",
|
"ctrl-space": "editor::ShowCompletions",
|
||||||
"cmd-.": "editor::ToggleCodeActions",
|
"cmd-.": "editor::ToggleCodeActions",
|
||||||
"alt-cmd-r": "editor::RevealInFinder",
|
"alt-cmd-r": "editor::RevealInFinder",
|
||||||
"ctrl-cmd-c": "editor::ShowCursors"
|
"ctrl-cmd-c": "editor::DisplayCursorNames"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -214,6 +214,6 @@ gpui::actions!(
|
||||||
Undo,
|
Undo,
|
||||||
UndoSelection,
|
UndoSelection,
|
||||||
UnfoldLines,
|
UnfoldLines,
|
||||||
ShowCursors
|
DisplayCursorNames
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -367,7 +367,7 @@ pub struct Editor {
|
||||||
project: Option<Model<Project>>,
|
project: Option<Model<Project>>,
|
||||||
collaboration_hub: Option<Box<dyn CollaborationHub>>,
|
collaboration_hub: Option<Box<dyn CollaborationHub>>,
|
||||||
blink_manager: Model<BlinkManager>,
|
blink_manager: Model<BlinkManager>,
|
||||||
display_cursors: bool,
|
show_cursor_names: bool,
|
||||||
hovered_cursor: Option<HoveredCursor>,
|
hovered_cursor: Option<HoveredCursor>,
|
||||||
pub show_local_selections: bool,
|
pub show_local_selections: bool,
|
||||||
mode: EditorMode,
|
mode: EditorMode,
|
||||||
|
@ -1613,7 +1613,7 @@ impl Editor {
|
||||||
pixel_position_of_newest_cursor: None,
|
pixel_position_of_newest_cursor: None,
|
||||||
gutter_width: Default::default(),
|
gutter_width: Default::default(),
|
||||||
style: None,
|
style: None,
|
||||||
display_cursors: false,
|
show_cursor_names: false,
|
||||||
hovered_cursor: Default::default(),
|
hovered_cursor: Default::default(),
|
||||||
editor_actions: Default::default(),
|
editor_actions: Default::default(),
|
||||||
show_copilot_suggestions: mode == EditorMode::Full,
|
show_copilot_suggestions: mode == EditorMode::Full,
|
||||||
|
@ -3899,17 +3899,17 @@ impl Editor {
|
||||||
self.update_visible_copilot_suggestion(cx);
|
self.update_visible_copilot_suggestion(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show_cursors(&mut self, _: &ShowCursors, cx: &mut ViewContext<Self>) {
|
pub fn display_cursor_names(&mut self, _: &DisplayCursorNames, cx: &mut ViewContext<Self>) {
|
||||||
self.display_cursors(cx);
|
self.show_cursor_names(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn display_cursors(&mut self, cx: &mut ViewContext<Self>) {
|
fn show_cursor_names(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
self.display_cursors = true;
|
self.show_cursor_names = true;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
cx.background_executor().timer(Duration::from_secs(2)).await;
|
cx.background_executor().timer(Duration::from_secs(2)).await;
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
this.display_cursors = false;
|
this.show_cursor_names = false;
|
||||||
cx.notify()
|
cx.notify()
|
||||||
})
|
})
|
||||||
.ok()
|
.ok()
|
||||||
|
@ -9021,7 +9021,7 @@ impl Editor {
|
||||||
cx.focus(&rename_editor_focus_handle);
|
cx.focus(&rename_editor_focus_handle);
|
||||||
} else {
|
} else {
|
||||||
self.blink_manager.update(cx, BlinkManager::enable);
|
self.blink_manager.update(cx, BlinkManager::enable);
|
||||||
self.display_cursors(cx);
|
self.show_cursor_names(cx);
|
||||||
self.buffer.update(cx, |buffer, cx| {
|
self.buffer.update(cx, |buffer, cx| {
|
||||||
buffer.finalize_last_transaction(cx);
|
buffer.finalize_last_transaction(cx);
|
||||||
if self.leader_peer_id.is_none() {
|
if self.leader_peer_id.is_none() {
|
||||||
|
|
|
@ -327,7 +327,7 @@ impl EditorElement {
|
||||||
register_action(view, cx, Editor::context_menu_prev);
|
register_action(view, cx, Editor::context_menu_prev);
|
||||||
register_action(view, cx, Editor::context_menu_next);
|
register_action(view, cx, Editor::context_menu_next);
|
||||||
register_action(view, cx, Editor::context_menu_last);
|
register_action(view, cx, Editor::context_menu_last);
|
||||||
register_action(view, cx, Editor::show_cursors);
|
register_action(view, cx, Editor::display_cursor_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn register_key_listeners(&self, cx: &mut WindowContext) {
|
fn register_key_listeners(&self, cx: &mut WindowContext) {
|
||||||
|
@ -2001,7 +2001,7 @@ impl EditorElement {
|
||||||
if Some(selection.peer_id) == editor.leader_peer_id {
|
if Some(selection.peer_id) == editor.leader_peer_id {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
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);
|
let is_shown = editor.show_cursor_names || editor.hovered_cursor.as_ref().is_some_and(|c| c.replica_id == selection.replica_id && c.selection_id == selection.selection.id);
|
||||||
|
|
||||||
remote_selections
|
remote_selections
|
||||||
.entry(selection.replica_id)
|
.entry(selection.replica_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue