From 778878418dfca779ccfe721898634f9b140db33c Mon Sep 17 00:00:00 2001 From: Ayush Kumar Anand <143122971+ayushk-1801@users.noreply.github.com> Date: Tue, 17 Mar 2026 08:22:03 +0530 Subject: [PATCH] Fix "Show Edit Predictions For This Buffer" button (#50845) Closes #48393 When switching the language of an unsaved buffer (e.g., from Plain Text to JavaScript), the editor's edit_prediction_settings were not recalculated. This caused the "This Buffer" toggle in the edit prediction menu to show a stale state, making the first click a no-op. I added a call to update_edit_prediction_settings in the LanguageChanged event handler so the editor immediately reflects the correct edit prediction state for the new language. Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fixed the "Show Edit Predictions For This Buffer" toggle being a no-op in unsaved buffers after switching the buffer's language. --- crates/editor/src/editor.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index da99dc45001548627317c3d2133859860a971a47..386e51340fd7288cbafbc831bc64751393f5cf37 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -23989,6 +23989,7 @@ impl Editor { } jsx_tag_auto_close::refresh_enabled_in_any_buffer(self, multibuffer, cx); cx.emit(EditorEvent::Reparsed(*buffer_id)); + self.update_edit_prediction_settings(cx); cx.notify(); } multi_buffer::Event::DirtyChanged => cx.emit(EditorEvent::DirtyChanged),