Add minimap into the editor controls (#30285)

Follow-up of https://github.com/zed-industries/zed/pull/26893

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-05-08 20:58:24 +03:00 committed by GitHub
parent f21780cef3
commit 2b6280ad56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 60 additions and 12 deletions

View file

@ -101,6 +101,8 @@ impl Render for QuickActionBar {
let show_edit_predictions = editor_value.edit_predictions_enabled();
let edit_predictions_enabled_at_cursor =
editor_value.edit_predictions_enabled_at_cursor(cx);
let supports_minimap = editor_value.supports_minimap();
let minimap_enabled = supports_minimap && editor_value.minimap().is_some();
let focus_handle = editor_value.focus_handle(cx);
@ -244,7 +246,6 @@ impl Render for QuickActionBar {
}
}
);
}
if supports_inline_diagnostics {
@ -270,6 +271,23 @@ impl Render for QuickActionBar {
);
}
if supports_minimap {
menu = menu.toggleable_entry("Minimap", minimap_enabled, IconPosition::Start, Some(editor::actions::ToggleMinimap.boxed_clone()), {
let editor = editor.clone();
move |window, cx| {
editor
.update(cx, |editor, cx| {
editor.toggle_minimap(
&editor::actions::ToggleMinimap,
window,
cx,
);
})
.ok();
}
},)
}
if has_edit_prediction_provider {
let mut inline_completion_entry = ContextMenuEntry::new("Edit Predictions")
.toggleable(IconPosition::Start, edit_predictions_enabled_at_cursor && show_edit_predictions)