mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-22 15:53:29 +01:00
Use first-line detection for STDIN
This commit is contained in:
parent
ce96df00b6
commit
e97095b724
@ -189,7 +189,9 @@ impl HighlightingAssets {
|
||||
let syntax = ext_syntax.or(line_syntax);
|
||||
syntax
|
||||
}
|
||||
(None, InputFile::StdIn) => None,
|
||||
(None, InputFile::StdIn) => String::from_utf8(reader.first_line.clone())
|
||||
.ok()
|
||||
.and_then(|l| self.syntax_set.find_syntax_by_first_line(&l)),
|
||||
(_, InputFile::ThemePreviewFile) => self.syntax_set.find_syntax_by_name("Rust"),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user