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
This commit is contained in:
Bennet Bo Fenner 2024-04-18 14:26:32 +02:00 committed by GitHub
parent c2428f9f5d
commit a202499c9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {