mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-01 19:02:22 +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:
@@ -1290,6 +1290,25 @@ fn grid_for_file_without_newline() {
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
// For ANSI theme, use underscore as a highlighter
|
||||
#[test]
|
||||
fn ansi_highlight_underline() {
|
||||
bat()
|
||||
.arg("--paging=never")
|
||||
.arg("--color=never")
|
||||
.arg("--terminal-width=80")
|
||||
.arg("--wrap=never")
|
||||
.arg("--decorations=always")
|
||||
.arg("--theme=ansi")
|
||||
.arg("--style=plain")
|
||||
.arg("--highlight-line=1")
|
||||
.write_stdin("Ansi Underscore Test\nAnother Line")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout("\x1B[4mAnsi Underscore Test\n\x1B[24mAnother Line")
|
||||
.stderr("");
|
||||
}
|
||||
|
||||
// Ensure that ANSI passthrough is emitted properly for both wrapping and non-wrapping printer.
|
||||
#[test]
|
||||
fn ansi_passthrough_emit() {
|
||||
|
Reference in New Issue
Block a user