feat: add zig language
This commit is contained in:
parent
73ebe230a1
commit
dd119391f7
3 changed files with 16 additions and 2 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -4,3 +4,6 @@
|
|||
[submodule "assets/catppuccin_theme"]
|
||||
path = assets/catppuccin_theme
|
||||
url = https://github.com/catppuccin/bat.git
|
||||
[submodule "assets/zig_syntax"]
|
||||
path = assets/zig_syntax
|
||||
url = https://github.com/ziglang/sublime-zig-language.git
|
||||
|
|
1
assets/zig_syntax
Submodule
1
assets/zig_syntax
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 1a4a38445fec495817625bafbeb01e79c44abcba
|
14
src/main.rs
14
src/main.rs
|
@ -11,7 +11,7 @@ use clap::{crate_authors, crate_version, Parser};
|
|||
use syntect::{
|
||||
easy::HighlightLines,
|
||||
highlighting::{Color, FontStyle, Style, Theme, ThemeSet},
|
||||
parsing::{SyntaxReference, SyntaxSet},
|
||||
parsing::{SyntaxDefinition, SyntaxReference, SyntaxSet},
|
||||
};
|
||||
|
||||
#[derive(Parser)]
|
||||
|
@ -80,7 +80,17 @@ fn main() -> anyhow::Result<()> {
|
|||
.context("Failed to load builtin theme")?,
|
||||
);
|
||||
}
|
||||
let ss = SyntaxSet::load_defaults_newlines();
|
||||
|
||||
let mut ssb = SyntaxSet::load_defaults_newlines().into_builder();
|
||||
|
||||
// TODO: this is completely retarded and unbearably slow
|
||||
ssb.add(SyntaxDefinition::load_from_str(
|
||||
include_str!("../assets/zig_syntax/Syntaxes/Zig.sublime-syntax"),
|
||||
true,
|
||||
Some("Zig"),
|
||||
)?);
|
||||
|
||||
let ss = ssb.build();
|
||||
|
||||
match opt.cmd {
|
||||
Cmd::ListThemes => {
|
||||
|
|
Loading…
Reference in a new issue