From f514c7cc187eeb814415d0e78546ac780c857900 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 14 Aug 2025 11:22:38 -0400 Subject: [PATCH] Emit a `BreadcrumbsChanged` event when associated settings changed (#36177) Closes https://github.com/zed-industries/zed/issues/36149 Release Notes: - Fixed a bug where changing the `toolbar.breadcrumbs` setting didn't immediately update the UI when saving the `settings.json` file. --- crates/editor/src/editor.rs | 6 ++++++ crates/editor/src/items.rs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index cbee9021ed6b22ce36ea9f0473eacab52329a971..689f3973412c2f2c884552364ca1646dfcb42457 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -20209,6 +20209,7 @@ impl Editor { ); let old_cursor_shape = self.cursor_shape; + let old_show_breadcrumbs = self.show_breadcrumbs; { let editor_settings = EditorSettings::get_global(cx); @@ -20222,6 +20223,10 @@ impl Editor { cx.emit(EditorEvent::CursorShapeChanged); } + if old_show_breadcrumbs != self.show_breadcrumbs { + cx.emit(EditorEvent::BreadcrumbsChanged); + } + let project_settings = ProjectSettings::get_global(cx); self.serialize_dirty_buffers = !self.mode.is_minimap() && project_settings.session.restore_unsaved_buffers; @@ -22843,6 +22848,7 @@ pub enum EditorEvent { }, Reloaded, CursorShapeChanged, + BreadcrumbsChanged, PushedToNavHistory { anchor: Anchor, is_deactivate: bool, diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 1da82c605d5cbf0555f864efc50dac97f323f777..480757a4911ed9b2ecb5b2ae09af736edf0a2b45 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -1036,6 +1036,10 @@ impl Item for Editor { f(ItemEvent::UpdateBreadcrumbs); } + EditorEvent::BreadcrumbsChanged => { + f(ItemEvent::UpdateBreadcrumbs); + } + EditorEvent::DirtyChanged => { f(ItemEvent::UpdateTab); }