mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 09:01:56 +00:00 
			
		
		
		
	Use first-line detection for STDIN
This commit is contained in:
		@@ -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"),
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user