From 0e2ce490656687ac1dce16fd581898517cf0534f Mon Sep 17 00:00:00 2001 From: Dong Date: Mon, 16 Mar 2026 21:45:58 +0800 Subject: [PATCH] markdown_preview: Fix not re-rendering issue when editing by agent (#50583) Closes #47900 ## Root cause The current markdown preview only re-renders on `EditorEvent::Edited, DirtyChanged, ExcerptsEdited`, but agent edits are implemented via [`buffer.edit()`](https://github.com/dongdong867/zed/blob/eb3f92708b6dc67bb534c1c44a200c0cb5c4997b/crates/agent/src/edit_agent.rs#L375) which does not guaranty to emit the `EditorEvent::Edited` event. Causing the markdown preview stuck on the last received parsed markdown. ## Applied fix Subscribing to `EditorEvent::BufferEdited` when initializing the markdown preview view. This will cause the view to update when received `BufferEdited` event including agent edits to the file. ## As is/ To be As is | To be --- | ---