Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure highlight scopes are skipped properly
Browse files Browse the repository at this point in the history
pascalkuthe committed Jun 5, 2024
1 parent 9dfc046 commit 7ae49de
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions helix-term/src/ui/document.rs
Original file line number Diff line number Diff line change
@@ -68,10 +68,7 @@ impl<H: Iterator<Item = HighlightEvent>> Iterator for StyleIter<'_, H> {
HighlightEvent::HighlightEnd => {
self.active_highlights.pop();
}
HighlightEvent::Source { start, mut end } => {
if start == end {
continue;
}
HighlightEvent::Source { mut end, .. } => {
let style = self
.active_highlights
.iter()
@@ -300,12 +297,12 @@ pub fn render_text<'t>(
}

// acquire the correct grapheme style
if char_pos >= syntax_style_span.1 {
while char_pos >= syntax_style_span.1 {
syntax_style_span = syntax_styles
.next()
.unwrap_or((Style::default(), usize::MAX));
}
if char_pos >= overlay_style_span.1 {
while char_pos >= overlay_style_span.1 {
overlay_style_span = overlay_styles
.next()
.unwrap_or((Style::default(), usize::MAX));

0 comments on commit 7ae49de

Please sign in to comment.