Skip to content

Commit 0c3b22e

Browse files
Run syntax highlighting when --binary=as-text
1 parent a769a3d commit 0c3b22e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/printer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ impl<'a> InteractivePrinter<'a> {
269269
.content_type
270270
.map_or(false, |c| c.is_binary() && !config.show_nonprintable);
271271

272-
let needs_to_match_syntax = !is_printing_binary
272+
let needs_to_match_syntax = (!is_printing_binary
273+
|| matches!(config.binary, BinaryBehavior::AsText))
273274
&& (config.colored_output || config.strip_ansi == StripAnsiMode::Auto);
274275

275276
let (is_plain_text, highlighter_from_set) = if needs_to_match_syntax {

0 commit comments

Comments
 (0)