Skip to content

editor: Fix DisplayMap::highlight_text not always sorting its ranges - #58260

Merged
Veykril merged 1 commit into
mainfrom
veykril/push-txvpozltwxto
Jun 2, 2026
Merged

editor: Fix DisplayMap::highlight_text not always sorting its ranges#58260
Veykril merged 1 commit into
mainfrom
veykril/push-txvpozltwxto

Conversation

@Veykril

@Veykril Veykril commented Jun 1, 2026

Copy link
Copy Markdown
Member

Release Notes:

  • N/A or Added/Fixed/Improved ...

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 1, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 1, 2026
@Veykril
Veykril requested a review from Anthony-Eid June 1, 2026 19:46
Comment on lines +1160 to +1168
None => {
ranges.sort_by(|a, b| a.start.cmp(&b.start, &multi_buffer_snapshot));
slot.insert(Arc::new((style, ranges)));
}
},
Entry::Vacant(slot) => _ = slot.insert(Arc::new((style, ranges))),
Entry::Vacant(slot) => {
ranges.sort_by(|a, b| a.start.cmp(&b.start, &multi_buffer_snapshot));
slot.insert(Arc::new((style, ranges)));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a debug assert we could put somewhere to make sure the ranges are always sorted

@Veykril
Veykril added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit 06065c0 Jun 2, 2026
44 checks passed
@Veykril
Veykril deleted the veykril/push-txvpozltwxto branch June 2, 2026 04:42
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants