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