editor: Prevent non‑boundary highlight indices in UTF‑8 (#38510)

Closes #38359

Release Notes:

- Use byte offsets for highlights; fix UTF‑8 crash
This commit is contained in:
Miao
2025-09-22 11:06:54 +02:00
committed by GitHub
parent 891a06c294
commit 271771c742
4 changed files with 52 additions and 24 deletions
@@ -1514,7 +1514,6 @@ impl PickerDelegate for DebugDelegate {
let highlighted_location = HighlightedMatch {
text: hit.string.clone(),
highlight_positions: hit.positions.clone(),
char_count: hit.string.chars().count(),
color: Color::Default,
};