mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 12:28:30 +00:00
be consistent
This commit is contained in:
parent
2a7851530d
commit
cea05e9f22
@ -146,10 +146,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|||||||
.long("highlight-line")
|
.long("highlight-line")
|
||||||
.overrides_with("highlight-line")
|
.overrides_with("highlight-line")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("n")
|
.value_name("N")
|
||||||
.help("Highlight a line.")
|
.help("Highlight a line.")
|
||||||
.long_help(
|
.long_help(
|
||||||
"Highlight the nth line. The background color is changed to create contrast.",
|
"Highlight the Nth line. The background color is changed to create contrast.",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -302,16 +302,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Line highlighting
|
// Line highlighting
|
||||||
let background = match self.config.highlight_line {
|
let background = self.config.highlight_line
|
||||||
Some(line) => {
|
.filter(|line| *line == line_number)
|
||||||
if line_number == line {
|
.map(|_| self.background_highlight)
|
||||||
self.background_highlight
|
.unwrap();
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Line contents.
|
// Line contents.
|
||||||
if self.config.output_wrap == OutputWrap::None {
|
if self.config.output_wrap == OutputWrap::None {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user