mirror of
https://github.com/sharkdp/bat.git
synced 2025-04-14 06:40:39 +01:00
Run syntax highlighting when --binary=as-text
This commit is contained in:
parent
a769a3d813
commit
0c3b22e0f0
@ -269,7 +269,8 @@ impl<'a> InteractivePrinter<'a> {
|
|||||||
.content_type
|
.content_type
|
||||||
.map_or(false, |c| c.is_binary() && !config.show_nonprintable);
|
.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);
|
&& (config.colored_output || config.strip_ansi == StripAnsiMode::Auto);
|
||||||
|
|
||||||
let (is_plain_text, highlighter_from_set) = if needs_to_match_syntax {
|
let (is_plain_text, highlighter_from_set) = if needs_to_match_syntax {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user