mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-02 03:12:25 +01:00
Underline highlighted lines in ANSI theme (#1985)
* Underline highlighted lines in ANSI theme * add test for ansi highlight underline, fix underscore in plain
This commit is contained in:
@@ -463,6 +463,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
let highlight_this_line =
|
||||
self.config.highlighted_lines.0.check(line_number) == RangeCheckResult::InRange;
|
||||
|
||||
if highlight_this_line && self.config.theme == "ansi" {
|
||||
self.ansi_style.update("^[4m");
|
||||
}
|
||||
|
||||
let background_color = self
|
||||
.background_color_highlight
|
||||
.filter(|_| highlight_this_line);
|
||||
@@ -649,6 +653,11 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
||||
writeln!(handle)?;
|
||||
}
|
||||
|
||||
if highlight_this_line && self.config.theme == "ansi" {
|
||||
self.ansi_style.update("^[24m");
|
||||
write!(handle, "\x1B[24m")?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user