Skip to content

Commit

Permalink
feat(graphical): add theming customization for linums
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Sep 22, 2021
1 parent 53416f2 commit 717f8e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/graphical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ impl GraphicalReportHandler {
write!(
f,
" {:width$} {} ",
linum.dimmed(),
linum.style(self.theme.styles.linum),
self.theme.characters.vbar,
width = width
)?;
Expand Down
5 changes: 5 additions & 0 deletions src/handlers/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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>(),
Expand All @@ -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(),
Expand All @@ -138,6 +142,7 @@ impl ThemeStyles {
code: style(),
help: style(),
link: style(),
linum: style(),
highlights: vec![style()],
}
}
Expand Down

0 comments on commit 717f8e3

Please sign in to comment.