editor: Fix cursor_shape regression by not setting it to "bar" (#17934)
This fixes the regression introduced here: https://github.com/zed-industries/zed/pull/17572#issuecomment-2355632615 Essentially: instead of always setting the value when saving settings, we don't set it by default, but fall back to the default value if it's not set. That fixes Vim mode's cursor being overwritten when settings change. Release Notes: - N/A
This commit is contained in:
@@ -1904,7 +1904,9 @@ impl Editor {
|
||||
linked_editing_range_task: Default::default(),
|
||||
pending_rename: Default::default(),
|
||||
searchable: true,
|
||||
cursor_shape: EditorSettings::get_global(cx).cursor_shape,
|
||||
cursor_shape: EditorSettings::get_global(cx)
|
||||
.cursor_shape
|
||||
.unwrap_or_default(),
|
||||
current_line_highlight: None,
|
||||
autoindent_mode: Some(AutoindentMode::EachLine),
|
||||
collapse_matches: false,
|
||||
@@ -11820,7 +11822,9 @@ impl Editor {
|
||||
cx,
|
||||
);
|
||||
let editor_settings = EditorSettings::get_global(cx);
|
||||
self.cursor_shape = editor_settings.cursor_shape;
|
||||
if let Some(cursor_shape) = editor_settings.cursor_shape {
|
||||
self.cursor_shape = cursor_shape;
|
||||
}
|
||||
self.scroll_manager.vertical_scroll_margin = editor_settings.vertical_scroll_margin;
|
||||
self.show_breadcrumbs = editor_settings.toolbar.breadcrumbs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user