reorganisation and cleanup

This commit is contained in:
Maddie H 2022-11-08 17:24:56 +00:00
parent b6a4c04a25
commit f6cc725850
No known key found for this signature in database
GPG Key ID: 64FAA9959751687D
9 changed files with 10 additions and 12 deletions

View File

@ -1 +0,0 @@
run = "cargo run"

View File

@ -11,8 +11,5 @@ include = ["src/*.rs", "Cargo.toml"]
categories = ["text-editors"]
keywords = ["text-editor", "editor", "terminal", "tui"]
[profile.release]
panic = abort
[dependencies]
crossterm = "0.25"

View File

@ -1,2 +1,2 @@
- [ ] Make components (i.e statusbar) modular
- [ ] Modularise functions
- [ ] Make components (i.e statusbar) modular

1
src/core/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod editor;

View File

@ -1,9 +1,8 @@
mod editor;
mod core;
mod terminal;
mod tui;
fn main() {
let lambda = editor::Editor::new();
let mut screen = terminal::Screen::new().unwrap();
tui::start(&mut screen, lambda);
let lambda = core::editor::Editor::new();
let mut screen = terminal::screen::Screen::new().unwrap();
terminal::tui::start(&mut screen, lambda);
}

2
src/terminal/mod.rs Normal file
View File

@ -0,0 +1,2 @@
pub mod screen;
pub mod tui;

View File

@ -1,5 +1,5 @@
use crate::editor::Editor;
use crate::terminal::{Coords, Screen};
use crate::core::editor::Editor;
use crate::terminal::screen::{Coords, Screen};
use crossterm::style::Stylize;
use crossterm::event::{read, Event, KeyCode, KeyEvent, KeyModifiers};