diff options
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r-- | helix-term/src/ui/editor.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 629cb85c..fced9acb 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -170,9 +170,11 @@ impl EditorView { // ugh, improve with a traverse method // or interleave highlight spans with selection and diagnostic spans - let style = if view.doc.diagnostics.iter().any(|diagnostic| { + let is_diagnostic = view.doc.diagnostics.iter().any(|diagnostic| { diagnostic.range.0 <= char_index && diagnostic.range.1 > char_index - }) { + }); + + let style = if is_diagnostic { style.clone().add_modifier(Modifier::UNDERLINED) } else { style |