Skip to content

Commit

Permalink
fixes #2856 by resetting style on diagnostic (#2861)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbromberger authored Jun 22, 2022
1 parent 301065f commit c107f4e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,13 @@ impl EditorView {

let mut lines = Vec::new();
for diagnostic in diagnostics {
let text = Text::styled(
&diagnostic.message,
match diagnostic.severity {
Some(Severity::Error) => error,
Some(Severity::Warning) | None => warning,
Some(Severity::Info) => info,
Some(Severity::Hint) => hint,
},
);
let style = Style::reset().patch(match diagnostic.severity {
Some(Severity::Error) => error,
Some(Severity::Warning) | None => warning,
Some(Severity::Info) => info,
Some(Severity::Hint) => hint,
});
let text = Text::styled(&diagnostic.message, style);
lines.extend(text.lines);
}

Expand Down

0 comments on commit c107f4e

Please sign in to comment.