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, 4 insertions, 7 deletions
diff --git a/helix-core/src/text_annotations.rs b/helix-core/src/text_annotations.rs index 9704c3d6..0f492b8b 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; +use crate::syntax::{Highlight, OverlayHighlights}; use crate::{Position, Tendril}; /// An inline annotation is continuous text shown @@ -300,10 +300,7 @@ impl<'a> TextAnnotations<'a> { } } - pub fn collect_overlay_highlights( - &self, - char_range: Range<usize>, - ) -> Vec<(usize, Range<usize>)> { + pub fn collect_overlay_highlights(&self, char_range: Range<usize>) -> OverlayHighlights { let mut highlights = Vec::new(); self.reset_pos(char_range.start); for char_idx in char_range { @@ -311,11 +308,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.0, char_idx..char_idx + 1)) + highlights.push((highlight, char_idx..char_idx + 1)); } } - highlights + OverlayHighlights::Heterogenous { highlights } } /// Add new inline annotations. |