diff options
author | Mahdi Dibaiee <mdibaiee@pm.me> | 2022-02-14 18:02:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 19:02:14 +0100 |
commit | d21f1e8f1792297510c32f661ab9bf2e94da9219 (patch) | |
tree | 71abe2f5a764497fdc9ad5b81a3a216d9d56d80b /src/printer.rs | |
parent | f6ce5d2054cc7ac2d556358e5b87370bd66b2bc8 (diff) |
Underline highlighted lines in ANSI theme (#1985)
* Underline highlighted lines in ANSI theme
* add test for ansi highlight underline, fix underscore in plain
Diffstat (limited to 'src/printer.rs')
-rw-r--r-- | src/printer.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/printer.rs b/src/printer.rs index 2c70421d..ad041e03 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -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(()) } } |