1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-03 18:51:44 +00:00

add line highlight

This commit is contained in:
Taylor
2018-10-09 22:25:33 -06:00
parent 5842d58c01
commit 1a6709c2cb
4 changed files with 38 additions and 2 deletions
+4
View File
@@ -64,6 +64,9 @@ pub struct Config<'a> {
/// The syntax highlighting theme
pub theme: String,
/// A line to highlight
pub highlight_line: Option<usize>,
}
fn is_truecolor_terminal() -> bool {
@@ -182,6 +185,7 @@ impl App {
.or_else(|| env::var("BAT_THEME").ok())
.unwrap_or(String::from(BAT_THEME_DEFAULT)),
line_range: transpose(self.matches.value_of("line-range").map(LineRange::from))?,
highlight_line: self.matches.value_of("highlight-line").and_then(|w| w.parse().ok()),
output_components,
})
}