separate terminal from ui
This commit is contained in:
parent
25b0da3962
commit
6f792ff546
@ -1,8 +1,9 @@
|
||||
mod core;
|
||||
mod terminal;
|
||||
mod tui;
|
||||
|
||||
fn main() {
|
||||
let lambda = core::editor::Editor::new();
|
||||
let mut screen = terminal::screen::Screen::new().unwrap();
|
||||
terminal::tui::start(&mut screen, lambda);
|
||||
tui::ui::start(&mut screen, lambda);
|
||||
}
|
||||
|
@ -1,4 +1 @@
|
||||
pub mod screen;
|
||||
pub mod tui;
|
||||
pub mod utils;
|
||||
mod components;
|
||||
pub mod screen;
|
@ -1,7 +1,7 @@
|
||||
use crossterm::style::Stylize;
|
||||
use crate::core::editor::Editor;
|
||||
use crate::terminal::screen::{Coords, Screen};
|
||||
use crate::terminal::utils;
|
||||
use crate::tui::utils;
|
||||
|
||||
pub fn draw(screen: &mut Screen, editor: &Editor) -> Result<(), ()> {
|
||||
// Calculate where to draw the status bar
|
@ -1,7 +1,7 @@
|
||||
use crossterm::style::Stylize;
|
||||
use crate::core::editor::Editor;
|
||||
use crate::terminal::screen::{Coords, Screen};
|
||||
use crate::terminal::utils;
|
||||
use crate::tui::utils;
|
||||
|
||||
pub fn draw(screen: &mut Screen, editor: &Editor) {
|
||||
// The welcome message
|
3
src/tui/mod.rs
Normal file
3
src/tui/mod.rs
Normal file
@ -0,0 +1,3 @@
|
||||
pub mod ui;
|
||||
pub mod utils;
|
||||
mod components;
|
@ -1,6 +1,6 @@
|
||||
use crate::core::editor::Editor;
|
||||
use crate::terminal::screen::Screen;
|
||||
use crate::terminal::components;
|
||||
use crate::tui::components;
|
||||
use crossterm::event::{read, Event, KeyCode, KeyEvent, KeyModifiers};
|
||||
|
||||
pub fn start(screen: &mut Screen, editor: Editor) {
|
Loading…
Reference in New Issue
Block a user