1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-07 05:42:25 +01:00

Use new default_theme fn for --list-themes

This commit is contained in:
Tau Gärtli
2024-04-16 14:43:50 +02:00
parent 06b645435a
commit 1b0a6da4be
2 changed files with 12 additions and 3 deletions

View File

@@ -19,6 +19,11 @@ pub const fn default_theme(color_scheme: ColorScheme) -> &'static str {
}
}
/// Detects the color scheme from the terminal.
pub fn color_scheme(when: DetectColorScheme) -> ColorScheme {
detect(when, &TerminalColorSchemeDetector).unwrap_or_default()
}
/// Options for configuring the theme used for syntax highlighting.
/// Used together with [`theme`].
#[derive(Debug, Default, PartialEq, Eq)]