1
Fork 0

Fix rustdoc test

This commit is contained in:
Esteban Küber 2025-02-27 22:29:22 +00:00
parent f1c751bc1a
commit cb82b79f02
2 changed files with 5 additions and 2 deletions

View file

@ -93,6 +93,9 @@ impl StyledBuffer {
if start == end {
return;
}
if start > self.lines[line].len() || end > self.lines[line].len() {
return;
}
let _ = self.lines[line].drain(start..(end - string.chars().count()));
for (i, c) in string.chars().enumerate() {
self.lines[line][start + i] = StyledChar::new(c, Style::LineNumber);