Revert "Hide the mouse when the user is typing in the editor (#25040)" (#25393)

This reverts commit a8610fbd13.

I've been seeing some reports of segmentation faults that appear to
point to this change as the culprit.

Closes #25366.

Release Notes:

- Community: Reverted #25040, so remove the corresponding entry from the
release notes.
This commit is contained in:
Marshall Bowers 2025-02-22 10:19:23 -05:00 committed by GitHub
parent 5043eaedc4
commit 7a55da58d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 28 additions and 127 deletions

View file

@ -729,8 +729,6 @@ pub struct Editor {
toggle_fold_multiple_buffers: Task<()>,
_scroll_cursor_center_top_bottom_task: Task<()>,
serialize_selections: Task<()>,
mouse_cursor_hidden: bool,
hide_mouse_while_typing: bool,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
@ -1454,10 +1452,6 @@ impl Editor {
serialize_selections: Task::ready(()),
text_style_refinement: None,
load_diff_task: load_uncommitted_diff,
mouse_cursor_hidden: false,
hide_mouse_while_typing: EditorSettings::get_global(cx)
.hide_mouse_while_typing
.unwrap_or(true),
};
this.tasks_update_task = Some(this.refresh_runnables(window, cx));
this._subscriptions.extend(project_subscriptions);
@ -2795,8 +2789,6 @@ impl Editor {
return;
}
self.mouse_cursor_hidden = self.hide_mouse_while_typing;
let selections = self.selections.all_adjusted(cx);
let mut bracket_inserted = false;
let mut edits = Vec::new();
@ -14611,11 +14603,6 @@ impl Editor {
self.scroll_manager.vertical_scroll_margin = editor_settings.vertical_scroll_margin;
self.show_breadcrumbs = editor_settings.toolbar.breadcrumbs;
self.cursor_shape = editor_settings.cursor_shape.unwrap_or_default();
self.hide_mouse_while_typing = editor_settings.hide_mouse_while_typing.unwrap_or(true);
if !self.hide_mouse_while_typing {
self.mouse_cursor_hidden = false;
}
}
if old_cursor_shape != self.cursor_shape {

View file

@ -37,7 +37,6 @@ pub struct EditorSettings {
pub auto_signature_help: bool,
pub show_signature_help_after_edits: bool,
pub jupyter: Jupyter,
pub hide_mouse_while_typing: Option<bool>,
}
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
@ -271,10 +270,6 @@ pub struct EditorSettingsContent {
///
/// Default: None
pub cursor_shape: Option<CursorShape>,
/// Determines whether the mouse cursor should be hidden while typing in an editor or input box.
///
/// Default: true
pub hide_mouse_while_typing: Option<bool>,
/// How to highlight the current line in the editor.
///
/// Default: all

View file

@ -853,7 +853,6 @@ impl EditorElement {
let modifiers = event.modifiers;
let gutter_hovered = gutter_hitbox.is_hovered(window);
editor.set_gutter_hovered(gutter_hovered, cx);
editor.mouse_cursor_hidden = false;
// Don't trigger hover popover if mouse is hovering over context menu
if text_hitbox.is_hovered(window) {
@ -4969,10 +4968,9 @@ impl EditorElement {
bounds: layout.position_map.text_hitbox.bounds,
}),
|window| {
let editor = self.editor.read(cx);
let cursor_style = if editor.mouse_cursor_hidden {
CursorStyle::None
} else if editor
let cursor_style = if self
.editor
.read(cx)
.hovered_link_state
.as_ref()
.is_some_and(|hovered_link_state| !hovered_link_state.links.is_empty())
@ -6984,7 +6982,6 @@ impl Element for EditorElement {
},
false,
);
// Offset the content_bounds from the text_bounds by the gutter margin (which
// is roughly half a character wide) to make hit testing work more like how we want.
let content_origin =