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 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/helix-core/src/text_annotations.rs b/helix-core/src/text_annotations.rs index 0f492b8b..ff28a8dd 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 @@ -211,7 +211,7 @@ impl<A, M> Layer<'_, A, M> { } impl<'a, A, M> From<(&'a [A], M)> for Layer<'a, A, M> { - fn from((annotations, metadata): (&'a [A], M)) -> Layer<'a, A, M> { + fn from((annotations, metadata): (&'a [A], M)) -> Layer<A, M> { Layer { annotations, current_index: Cell::new(0), @@ -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. |