curd-editor 0.2.0

A tiny terminal text editor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod document;
mod editor;
mod terminal;

use document::Document;
use editor::Editor;
use terminal::Terminal;

fn main() -> std::io::Result<()> {
    let document = match std::env::args().nth(1) {
        Some(path) => Document::open(&path)?,
        None => Document::default(),
    };

    let _terminal = Terminal::start()?;
    let mut editor = Editor::new(document);
    editor.run()
}