From a202499c9a61bbb7ec2498b196c94237223372a0 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:26:32 +0200 Subject: [PATCH] markdown preview: Update channel notes when other collaborator changes buffer (#10718) https://github.com/zed-industries/zed/assets/53836821/9a57885e-83b0-49fb-b3a8-0a7868566b85 Release Notes: - Markdown preview now re-renders when another collaborator changes the content of channel notes --- crates/collab_ui/src/channel_view.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/collab_ui/src/channel_view.rs b/crates/collab_ui/src/channel_view.rs index 59099dd486..49753ccd6f 100644 --- a/crates/collab_ui/src/channel_view.rs +++ b/crates/collab_ui/src/channel_view.rs @@ -305,6 +305,10 @@ impl ChannelView { }); } ChannelBufferEvent::BufferEdited => { + // Emit the edited event on the editor context so that other views can update it's state (e.g. markdown preview) + self.editor.update(cx, |_, cx| { + cx.emit(EditorEvent::Edited); + }); if self.editor.read(cx).is_focused(cx) { self.acknowledge_buffer_version(cx); } else {