blob: d6c6c4995c25da97558ac02a2ffbf8009befd8b0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#![allow(unused)]
#[macro_use]
mod macros;
mod editor;
mod keymap;
mod theme;
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();
println!("{:?}", args.files);
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(())
}
|