Revert "gpui: Assert validity of text runs for StyleText" (#39708)

Reverts zed-industries/zed#39581

This has done its job uncovering incorrect constructions of the
highlight ranges pretty fast. Reverting this to prevent this from
spilling into preview until I can fix the call sites next week
This commit is contained in:
Lukas Wirth
2025-10-07 19:08:33 +00:00
committed by GitHub
parent 642643de01
commit 7db7ad93a2
3 changed files with 10 additions and 20 deletions
+5 -1
View File
@@ -225,15 +225,19 @@ impl LineWrapper {
fn update_runs_after_truncation(result: &str, ellipsis: &str, runs: &mut Vec<TextRun>) {
let mut truncate_at = result.len() - ellipsis.len();
let mut run_end = None;
for (run_index, run) in runs.iter_mut().enumerate() {
if run.len <= truncate_at {
truncate_at -= run.len;
} else {
run.len = truncate_at + ellipsis.len();
runs.truncate(run_index + 1);
run_end = Some(run_index + 1);
break;
}
}
if let Some(run_end) = run_end {
runs.truncate(run_end);
}
}
/// A fragment of a line that can be wrapped.