mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 12:54:42 +00:00
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** <img wdth="234" alt="Screenshot 2024-03-21 at 19 53 34" src="https://github.com/zed-industries/zed/assets/62463826/bf9e7fec-1563-415b-9b14-f7b95fc7d784"> **After** <img width="234" alt="Screenshot 2024-03-21 at 19 53 48" src="https://github.com/zed-industries/zed/assets/62463826/c0b7ba3a-5bdc-4b9e-a4f2-c3df4064f0ec"> Release Notes: - N/A
This commit is contained in:
parent
3b7cd9cf1e
commit
35e3935e8f
1 changed files with 1 additions and 1 deletions
|
@ -762,7 +762,7 @@ impl ChatPanel {
|
||||||
|
|
||||||
if message.edited_at.is_some() {
|
if message.edited_at.is_some() {
|
||||||
rich_text.highlights.push((
|
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 {
|
Highlight::Highlight(HighlightStyle {
|
||||||
fade_out: Some(0.8),
|
fade_out: Some(0.8),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
Loading…
Reference in a new issue