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