Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix clear reply to message and edit message state when you switch state (#10044)

Remco Smitsc0d117182fc4
diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs
index 39dfb46c655..f1e3cab3524 100644
--- a/crates/collab_ui/src/chat_panel.rs
+++ b/crates/collab_ui/src/chat_panel.rs
@@ -615,6 +615,8 @@ impl ChatPanel {
.child(
IconButton::new(("reply", message_id), IconName::ReplyArrowRight)
.on_click(cx.listener(move |this, _, cx| {
+ this.cancel_edit_message(cx);
+
this.message_editor.update(cx, |editor, cx| {
editor.set_reply_to_message_id(message_id);
editor.focus_handle(cx).focus(cx);
@@ -636,6 +638,8 @@ impl ChatPanel {
IconButton::new(("edit", message_id), IconName::Pencil)
.on_click(cx.listener(move |this, _, cx| {
this.message_editor.update(cx, |editor, cx| {
+ editor.clear_reply_to_message_id();
+
let message = this
.active_chat()
.and_then(|active_chat| {