Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/text_annotations.rs')
| -rw-r--r-- | helix-core/src/text_annotations.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/helix-core/src/text_annotations.rs b/helix-core/src/text_annotations.rs index 0f492b8b..9704c3d6 100644 --- a/helix-core/src/text_annotations.rs +++ b/helix-core/src/text_annotations.rs @@ -5,7 +5,7 @@ use std::ops::Range; use std::ptr::NonNull; use crate::doc_formatter::FormattedGrapheme; -use crate::syntax::{Highlight, OverlayHighlights}; +use crate::syntax::Highlight; use crate::{Position, Tendril}; /// An inline annotation is continuous text shown @@ -300,7 +300,10 @@ impl<'a> TextAnnotations<'a> { } } - pub fn collect_overlay_highlights(&self, char_range: Range<usize>) -> OverlayHighlights { + pub fn collect_overlay_highlights( + &self, + char_range: Range<usize>, + ) -> Vec<(usize, Range<usize>)> { let mut highlights = Vec::new(); self.reset_pos(char_range.start); for char_idx in char_range { @@ -308,11 +311,11 @@ impl<'a> TextAnnotations<'a> { // we don't know the number of chars the original grapheme takes // however it doesn't matter as highlight boundaries are automatically // aligned to grapheme boundaries in the rendering code - highlights.push((highlight, char_idx..char_idx + 1)); + highlights.push((highlight.0, char_idx..char_idx + 1)) } } - OverlayHighlights::Heterogenous { highlights } + highlights } /// Add new inline annotations. |