Skip to content

Commit

Permalink
Run syntax highlighting when --binary=as-text
Browse files Browse the repository at this point in the history
  • Loading branch information
einfachIrgendwer0815 committed Jun 28, 2024
1 parent 283b494 commit ec099c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ec099c3

Please sign in to comment.