Merge pull request #202 from jonathandturner/add_bat_syntax

Add a more complete syntax file (from bat)
This commit is contained in:
Jonathan Turner 2019-07-22 04:31:57 +12:00 committed by GitHub
commit 12a785f2a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

BIN
assets/syntaxes.bin Normal file

Binary file not shown.

View File

@ -84,7 +84,9 @@ fn view_text_value(value: &Spanned<Value>, source_map: &SourceMap) {
use syntect::util::{as_24_bit_terminal_escaped, LinesWithEndings};
// Load these once at the start of your program
let ps = SyntaxSet::load_defaults_newlines();
let ps: SyntaxSet = syntect::dumps::from_binary(include_bytes!(
"../../assets/syntaxes.bin"
));
if let Some(syntax) =
ps.find_syntax_by_extension(extension.to_str().unwrap())