1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-22 05:02:30 +01:00

Remove code that tries to handle ANSI escape inputs

Syntax highlighting is broken when input contains ANSI escape characters
anyway, so there is not much point in trying to handle ANSI escapes in
input.
This commit is contained in:
Martin Nordholts
2022-05-10 08:34:13 +02:00
parent a6297b282c
commit 8174e02279
6 changed files with 114 additions and 390 deletions

View File

@@ -1419,25 +1419,6 @@ fn ansi_highlight_underline() {
.stderr("");
}
// Ensure that ANSI passthrough is emitted properly for both wrapping and non-wrapping printer.
#[test]
fn ansi_passthrough_emit() {
for wrapping in &["never", "character"] {
bat()
.arg("--paging=never")
.arg("--color=never")
.arg("--terminal-width=80")
.arg(format!("--wrap={}", wrapping))
.arg("--decorations=always")
.arg("--style=plain")
.write_stdin("\x1B[33mColor\nColor \x1B[m\nPlain\n")
.assert()
.success()
.stdout("\x1B[33m\x1B[33mColor\n\x1B[33mColor \x1B[m\nPlain\n")
.stderr("");
}
}
#[test]
fn ignored_suffix_arg() {
bat()