Add setting for minimap on active editor only (#31390)
Release Notes: - Add a setting to show the minimap only on the current active editor (file) - This can be configured on `settings.json`: ```json { "minimap": { "display_in": "active_editor", // defaults to "all_editors" } } ``` - The minimap won't hide if you go from an editor pane to the terminal, the project panel, the search bar, etc. It will only hide if you go from one editor pane to another. Preview:  Only the active editor (left) displays the minimap.
This commit is contained in:
parent
a69ebf038a
commit
4bbb7b5c2f
3 changed files with 44 additions and 0 deletions
|
@ -1777,6 +1777,19 @@ impl EditorElement {
|
|||
|
||||
let minimap_settings = EditorSettings::get_global(cx).minimap;
|
||||
|
||||
if minimap_settings.on_active_editor() {
|
||||
let active_editor = self.editor.read(cx).workspace().and_then(|ws| {
|
||||
ws.read(cx)
|
||||
.active_pane()
|
||||
.read(cx)
|
||||
.active_item()
|
||||
.and_then(|i| i.act_as::<Editor>(cx))
|
||||
});
|
||||
if active_editor.is_some_and(|e| e != self.editor) {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
if !snapshot.mode.is_full()
|
||||
|| minimap_width.is_zero()
|
||||
|| matches!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue