fix: search result advancing highlight

This commit is contained in:
2026-06-02 00:35:40 +01:00
parent 6f3245f927
commit ccc93d2429
2 changed files with 39 additions and 25 deletions

View File

@@ -122,9 +122,9 @@ impl HighlightedContent {
&self.0[line].line_range
}
pub(crate) fn extended_with_highlights(
pub(crate) fn extended_with_highlights<'a>(
mut self,
highlights: impl Iterator<Item = HighlightedRange>,
highlights: impl Iterator<Item = &'a HighlightedRange>,
) -> Self {
let total_line_count = self.0.len();
let mut current_line: usize = 0;
@@ -191,8 +191,6 @@ impl HighlightedContent {
pub(crate) fn replace_highlight_range(&mut self, highlighted_range: &HighlightedRange) {
let (range, _) = &highlighted_range;
println!("finding range to replace {:?}", range);
let line = self
.line_index_of_range(range)
.map(|line_i| &mut self.0[line_i]);