Skip to content

markdown_preview: Fix not re-rendering issue when editing by agent#50583

Merged
Veykril merged 1 commit intozed-industries:mainfrom
dongdong867:fix/markdown-preview-not-rerendering
Mar 16, 2026
Merged

markdown_preview: Fix not re-rendering issue when editing by agent#50583
Veykril merged 1 commit intozed-industries:mainfrom
dongdong867:fix/markdown-preview-not-rerendering

Conversation

@dongdong867
Copy link
Copy Markdown
Contributor

Closes #47900

Root cause

The current markdown preview only re-renders on EditorEvent::Edited, DirtyChanged, ExcerptsEdited, but agent edits are implemented via buffer.edit() 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
zed_markdown_preview_as_is.mp4
zed_markdown_preview_to_be.mp4

Before you mark this PR as ready for review, make sure that you have:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Release Notes:

  • Fixed markdown preview not re-rendering when edited by agent

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 3, 2026
Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril merged commit 0e2ce49 into zed-industries:main Mar 16, 2026
38 checks passed
@dongdong867 dongdong867 deleted the fix/markdown-preview-not-rerendering branch March 16, 2026 13:48
@zelenenka zelenenka added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:preview/markdown cla-signed The user has signed the Contributor License Agreement guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zed's "Preview Markdown" view does not re-render correctly when markdown file is edited by agent.

4 participants