aboutsummaryrefslogblamecommitdiff
path: root/helix-term/src/main.rs
blob: eeb498bcc67539e97cef1ae921c6436b888e0195 (plain) (tree)
1
2
3
4
5
6
7
8
9
                 
 
           
 
                   
 
                     
                       
 
                  
 
                                                  
                                









                                                    
 





                                                                                          

          
#![allow(unused)]

mod editor;

use editor::Editor;

use clap::{App, Arg};
use std::path::PathBuf;

use anyhow::Error;

static EX: smol::Executor = smol::Executor::new();

fn main() -> Result<(), Error> {
    let args = App::new("helix")
        .version("0.1")
        .about("A post-modern text editor.")
        .arg(
            Arg::new("files")
                .about("Sets the input file to use")
                .required(true)
                .multiple(true)
                .index(1),
        )
        .get_matches();

    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(())
}