1
0
Fork 0
mirror of https://github.com/helix-editor/helix synced 2024-06-01 07:46:05 +02:00
helix/helix-term/src/main.rs
Blaž Hrastnik 935cfeae57 Split parts of helix-term into helix-view.
It still largely depends on term for some types but I plan to change
that later.
2020-09-21 18:24:16 +09:00

34 lines
609 B
Rust

#![allow(unused)]
mod editor;
use editor::Editor;
use argh::FromArgs;
use std::path::PathBuf;
use anyhow::Error;
#[derive(FromArgs)]
/// A post-modern text editor.
pub struct Args {
#[argh(positional)]
files: Vec<PathBuf>,
}
static EX: smol::Executor = smol::Executor::new();
fn main() -> Result<(), Error> {
let args: Args = argh::from_env();
for _ in 0..num_cpus::get() {
std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>())));
}
smol::block_on(EX.run(async {
editor::Editor::new(args).unwrap().run().await;
}));
Ok(())
}