From c5c0576ec69d5ccc3700dd6fc411d071bb0114a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 16 Sep 2021 18:22:52 -0700 Subject: [PATCH] feat(theme): rename some theme items for clarity BREAKING CHANGE: These were part of the public API, so if you were using theming, this might have broken for you --- src/handlers/graphical.rs | 4 +-- src/handlers/theme.rs | 59 +++++++++++++++++++++++++++------------ 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/handlers/graphical.rs b/src/handlers/graphical.rs index 522bf9e..32a4efd 100644 --- a/src/handlers/graphical.rs +++ b/src/handlers/graphical.rs @@ -162,9 +162,9 @@ impl GraphicalReportHandler { fn render_causes(&self, f: &mut impl fmt::Write, diagnostic: &(dyn Diagnostic)) -> fmt::Result { let (severity_style, severity_icon) = match diagnostic.severity() { - Some(Severity::Error) | None => (self.theme.styles.error, self.theme.characters.x), + Some(Severity::Error) | None => (self.theme.styles.error, self.theme.characters.error), Some(Severity::Warning) => (self.theme.styles.warning, self.theme.characters.warning), - Some(Severity::Advice) => (self.theme.styles.advice, self.theme.characters.point_right), + Some(Severity::Advice) => (self.theme.styles.advice, self.theme.characters.advice), }; let initial_indent = format!(" {} ", severity_icon.style(severity_style)); diff --git a/src/handlers/theme.rs b/src/handlers/theme.rs index 344abb7..fb4c3fa 100644 --- a/src/handlers/theme.rs +++ b/src/handlers/theme.rs @@ -82,8 +82,8 @@ pub struct ThemeStyles { pub code: Style, /// Style to apply to the help text. pub help: Style, - /// Style to apply to the filename/source name. - pub filename: Style, + /// Style to apply to filenames/links/URLs. + pub link: Style, /// Styles to cycle through (using `.iter().cycle()`), to render the lines /// and text for diagnostic highlights. pub highlights: Vec