feat(graphical): add theming customization for linums

This commit is contained in:
Kat Marchán 2021-09-22 12:30:16 -07:00
parent 53416f25be
commit 717f8e3d88
2 changed files with 6 additions and 1 deletions

View File

@ -513,7 +513,7 @@ impl GraphicalReportHandler {
write!(
f,
" {:width$} {} ",
linum.dimmed(),
linum.style(self.theme.styles.linum),
self.theme.characters.vbar,
width = width
)?;

View File

@ -84,6 +84,8 @@ pub struct ThemeStyles {
pub help: Style,
/// Style to apply to filenames/links/URLs.
pub link: Style,
/// Style to apply to line numbers.
pub linum: Style,
/// Styles to cycle through (using `.iter().cycle()`), to render the lines
/// and text for diagnostic highlights.
pub highlights: Vec<Style>,
@ -104,6 +106,7 @@ impl ThemeStyles {
code: style().fg_rgb::<92, 157, 255>(),
help: style().fg_rgb::<106, 159, 181>(),
link: style().fg_rgb::<92, 157, 255>().underline().bold(),
linum: style().dimmed(),
highlights: vec![
style().fg_rgb::<246, 87, 248>(),
style().fg_rgb::<30, 201, 212>(),
@ -121,6 +124,7 @@ impl ThemeStyles {
code: style().yellow(),
help: style().cyan(),
link: style().cyan().underline().bold(),
linum: style().dimmed(),
highlights: vec![
style().red().bold(),
style().yellow().bold(),
@ -138,6 +142,7 @@ impl ThemeStyles {
code: style(),
help: style(),
link: style(),
linum: style(),
highlights: vec![style()],
}
}