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 invalid highlight position for `(edited)` text (#9660)

Remco Smits35e3935e8f33
diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs
index ff78ccde9ce..39dfb46c655 100644
--- a/crates/collab_ui/src/chat_panel.rs
+++ b/crates/collab_ui/src/chat_panel.rs
@@ -762,7 +762,7 @@ impl ChatPanel {
if message.edited_at.is_some() {
rich_text.highlights.push((
- message.body.len()..(message.body.len() + MESSAGE_UPDATED.len()),
+ (rich_text.text.len() - MESSAGE_UPDATED.len())..rich_text.text.len(),
Highlight::Highlight(HighlightStyle {
fade_out: Some(0.8),
..Default::default()