editor: Do not use hide_mouse_while_typing for single line editor (#27536)
Release Notes: - N/A
This commit is contained in:
@@ -1409,6 +1409,14 @@ impl Editor {
|
|||||||
code_action_providers.push(Rc::new(project) as Rc<_>);
|
code_action_providers.push(Rc::new(project) as Rc<_>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let hide_mouse_while_typing = if !matches!(mode, EditorMode::SingleLine { .. }) {
|
||||||
|
EditorSettings::get_global(cx)
|
||||||
|
.hide_mouse_while_typing
|
||||||
|
.unwrap_or(true)
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
};
|
||||||
|
|
||||||
let mut this = Self {
|
let mut this = Self {
|
||||||
focus_handle,
|
focus_handle,
|
||||||
show_cursor_when_unfocused: false,
|
show_cursor_when_unfocused: false,
|
||||||
@@ -1571,9 +1579,7 @@ impl Editor {
|
|||||||
text_style_refinement: None,
|
text_style_refinement: None,
|
||||||
load_diff_task: load_uncommitted_diff,
|
load_diff_task: load_uncommitted_diff,
|
||||||
mouse_cursor_hidden: false,
|
mouse_cursor_hidden: false,
|
||||||
hide_mouse_while_typing: EditorSettings::get_global(cx)
|
hide_mouse_while_typing,
|
||||||
.hide_mouse_while_typing
|
|
||||||
.unwrap_or(true),
|
|
||||||
};
|
};
|
||||||
if let Some(breakpoints) = this.breakpoint_store.as_ref() {
|
if let Some(breakpoints) = this.breakpoint_store.as_ref() {
|
||||||
this._subscriptions
|
this._subscriptions
|
||||||
@@ -16684,7 +16690,11 @@ impl Editor {
|
|||||||
self.scroll_manager.vertical_scroll_margin = editor_settings.vertical_scroll_margin;
|
self.scroll_manager.vertical_scroll_margin = editor_settings.vertical_scroll_margin;
|
||||||
self.show_breadcrumbs = editor_settings.toolbar.breadcrumbs;
|
self.show_breadcrumbs = editor_settings.toolbar.breadcrumbs;
|
||||||
self.cursor_shape = editor_settings.cursor_shape.unwrap_or_default();
|
self.cursor_shape = editor_settings.cursor_shape.unwrap_or_default();
|
||||||
self.hide_mouse_while_typing = editor_settings.hide_mouse_while_typing.unwrap_or(true);
|
self.hide_mouse_while_typing = if !matches!(self.mode, EditorMode::SingleLine { .. }) {
|
||||||
|
editor_settings.hide_mouse_while_typing.unwrap_or(true)
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
};
|
||||||
|
|
||||||
if !self.hide_mouse_while_typing {
|
if !self.hide_mouse_while_typing {
|
||||||
self.mouse_cursor_hidden = false;
|
self.mouse_cursor_hidden = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user