diff options
author | Blaž Hrastnik | 2021-01-08 07:31:19 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-01-08 07:37:36 +0000 |
commit | 777a80917db01e658139da11a20ff08256667cfe (patch) | |
tree | be813dfd5f59a6f4c4db937c12769927d8d42c13 /helix-term/src/ui/editor.rs | |
parent | 7d41550a23fc3506a37016d5bc362144fb00c080 (diff) |
Address clippy lints.
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 |