aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/main.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-25 06:26:25 +0000
committerBlaž Hrastnik2021-03-25 06:26:25 +0000
commite3c4edae32f6d70bf20655c7c25b3cdf39f3f281 (patch)
tree5351a5a797de5f213b87f25ae4ba049c8e74d11b /helix-term/src/main.rs
parenta900159a863c24e4afb1485d8dcff760f722f36b (diff)
Add the machinery to load syntax config from TOML.
It's embedded into the binary at build time for now, but it's progress.
Diffstat (limited to 'helix-term/src/main.rs')
-rw-r--r--helix-term/src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs
index 84b52ea2..dc6f31f4 100644
--- a/helix-term/src/main.rs
+++ b/helix-term/src/main.rs
@@ -73,6 +73,14 @@ fn main() {
setup_logging(verbosity).expect("failed to initialize logging.");
+ // initialize language registry
+ use helix_core::syntax::{Loader, LOADER};
+ let toml = include_str!("../../languages.toml");
+ LOADER.get_or_init(|| {
+ let config = toml::from_str(&toml).expect("Could not parse languages.toml");
+ Loader::new(config)
+ });
+
for _ in 0..num_cpus::get() {
std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>())));
}