zed/crates/markdown_preview
Wesley Weisenberger 0e83147823
markdown_preview: Fix slow checkbox check/uncheck UI updates (#48633)
When checking a box in the markdown preview, it's generally very slow.

Preview updates when typing in the editor are debounced to be every
200ms, but when clicking an element in the preview, it feels sluggish to
wait that long.

In debugging, I found that the debounced task from the editor event
subscriptions replaced the non-debounced event on [line
605](263d8e58d8/crates/markdown_preview/src/markdown_preview_view.rs (L600C49-L602C51)),
and the UI took around 200 ms to update.

Therefore, I've changed the markdown parsing function to not replace the
task, unless another non-debounced task comes along. UI updates from the
editor are still debounced.

Before: 

[Screencast_20260206_145702.webm](https://github.com/user-attachments/assets/fed5f8fa-866e-4291-9ec3-f876bb6dc6ab)

After:

[Screencast_20260206_150124.webm](https://github.com/user-attachments/assets/e4e7dc2b-d899-42ff-bd28-ad1dc5a8d3d9)

Release Notes:

- Improved speed at which markdown lists update after checking or
unchecking items
2026-03-06 17:23:50 +01:00
..
src markdown_preview: Fix slow checkbox check/uncheck UI updates (#48633) 2026-03-06 17:23:50 +01:00
Cargo.toml markdown_preview: Enable parser options individually (#50440) 2026-03-05 14:00:08 +00:00
LICENSE-GPL