From ec099c369f11f42478881153dd03233c9dc9c093 Mon Sep 17 00:00:00 2001 From: einfachIrgendwer0815 <85333734+einfachIrgendwer0815@users.noreply.github.com> Date: Sat, 1 Jun 2024 00:13:03 +0200 Subject: [PATCH] Run syntax highlighting when `--binary=as-text` --- src/printer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printer.rs b/src/printer.rs index 3398b217dd..95017188c3 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -269,7 +269,8 @@ impl<'a> InteractivePrinter<'a> { .content_type .map_or(false, |c| c.is_binary() && !config.show_nonprintable); - let needs_to_match_syntax = !is_printing_binary + let needs_to_match_syntax = (!is_printing_binary + || matches!(config.binary, BinaryBehavior::AsText)) && (config.colored_output || config.strip_ansi == StripAnsiMode::Auto); let (is_plain_text, highlighter_from_set) = if needs_to_match_syntax {