From 2a5925c23534d013fda5533fb8e992360adaf062 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 19 Sep 2024 13:26:14 -0400 Subject: [PATCH] Fix bug where copying from assistant panel appends extra newline to clipboard (#18090) Closes https://github.com/zed-industries/zed/issues/17661 Release Notes: - Fixed a bug where copying from the assistant panel appended an additional newline to the end of the clipboard contents. --- crates/assistant/src/assistant_panel.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index da176ebeee61e0565666ebdb6d074d09008da1ad..364c6f9663120cc89f0647f1d9dc26b26e7ff3f6 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -3533,7 +3533,9 @@ impl ContextEditor { for chunk in context.buffer().read(cx).text_for_range(range) { text.push_str(chunk); } - text.push('\n'); + if message.offset_range.end < selection.range().end { + text.push('\n'); + } } } }