From 35e3935e8f33d31e9afa0a8a44154603d232baa7 Mon Sep 17 00:00:00 2001 From: Remco Smits Date: Thu, 21 Mar 2024 20:37:45 +0100 Subject: [PATCH] Fix invalid highlight position for `(edited)` text (#9660) This pull request fixes a bug that was inserting the wrong position for the `(edited)` text. This is only an issue when you have other styling inside the markdown that causes the `richt_text.text.len()` to increase. **Before** Screenshot 2024-03-21 at 19 53 34 **After** Screenshot 2024-03-21 at 19 53 48 Release Notes: - N/A --- crates/collab_ui/src/chat_panel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs index ff78ccde9c..39dfb46c65 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()