mirror of https://github.com/zkat/miette.git
feat(graphical): add theming customization for linums
This commit is contained in:
parent
53416f25be
commit
717f8e3d88
|
|
@ -513,7 +513,7 @@ impl GraphicalReportHandler {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
" {:width$} {} ",
|
" {:width$} {} ",
|
||||||
linum.dimmed(),
|
linum.style(self.theme.styles.linum),
|
||||||
self.theme.characters.vbar,
|
self.theme.characters.vbar,
|
||||||
width = width
|
width = width
|
||||||
)?;
|
)?;
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,8 @@ pub struct ThemeStyles {
|
||||||
pub help: Style,
|
pub help: Style,
|
||||||
/// Style to apply to filenames/links/URLs.
|
/// Style to apply to filenames/links/URLs.
|
||||||
pub link: Style,
|
pub link: Style,
|
||||||
|
/// Style to apply to line numbers.
|
||||||
|
pub linum: Style,
|
||||||
/// Styles to cycle through (using `.iter().cycle()`), to render the lines
|
/// Styles to cycle through (using `.iter().cycle()`), to render the lines
|
||||||
/// and text for diagnostic highlights.
|
/// and text for diagnostic highlights.
|
||||||
pub highlights: Vec<Style>,
|
pub highlights: Vec<Style>,
|
||||||
|
|
@ -104,6 +106,7 @@ impl ThemeStyles {
|
||||||
code: style().fg_rgb::<92, 157, 255>(),
|
code: style().fg_rgb::<92, 157, 255>(),
|
||||||
help: style().fg_rgb::<106, 159, 181>(),
|
help: style().fg_rgb::<106, 159, 181>(),
|
||||||
link: style().fg_rgb::<92, 157, 255>().underline().bold(),
|
link: style().fg_rgb::<92, 157, 255>().underline().bold(),
|
||||||
|
linum: style().dimmed(),
|
||||||
highlights: vec![
|
highlights: vec![
|
||||||
style().fg_rgb::<246, 87, 248>(),
|
style().fg_rgb::<246, 87, 248>(),
|
||||||
style().fg_rgb::<30, 201, 212>(),
|
style().fg_rgb::<30, 201, 212>(),
|
||||||
|
|
@ -121,6 +124,7 @@ impl ThemeStyles {
|
||||||
code: style().yellow(),
|
code: style().yellow(),
|
||||||
help: style().cyan(),
|
help: style().cyan(),
|
||||||
link: style().cyan().underline().bold(),
|
link: style().cyan().underline().bold(),
|
||||||
|
linum: style().dimmed(),
|
||||||
highlights: vec![
|
highlights: vec![
|
||||||
style().red().bold(),
|
style().red().bold(),
|
||||||
style().yellow().bold(),
|
style().yellow().bold(),
|
||||||
|
|
@ -138,6 +142,7 @@ impl ThemeStyles {
|
||||||
code: style(),
|
code: style(),
|
||||||
help: style(),
|
help: style(),
|
||||||
link: style(),
|
link: style(),
|
||||||
|
linum: style(),
|
||||||
highlights: vec![style()],
|
highlights: vec![style()],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue