diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 00:36:10 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 00:36:10 +0200 |
| commit | fe0938b1de0c46fc2afcaa3dcd6a0f4ec870d21a (patch) | |
| tree | 8db7509894842395cfb309f00c41b7f4d173888c /src/app.rs | |
| parent | 1e1eb95926f556e666bc20355327abd24d264858 (diff) | |
add state which is shared with the lua environment
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,10 +1,7 @@ use std::{io, time::Duration}; use crate::{ - config, lua, - sheet::register::Register, - tui, - widgets::{logview::LogView, sheetview::SheetView}, + config, lua, sheet::register::Register, state::GlobalState, tui, widgets::{logview::LogView, sheetview::SheetView} }; use ratatui::{ @@ -22,7 +19,8 @@ pub struct App { impl App { pub fn new() -> Self { let sheet_id = Register::create(10, 50); - let view = SheetView::new(sheet_id); + GlobalState::instance_mut().sheetview.set_active_sheet(Some(sheet_id)); + let view = SheetView::new(); Self { exit: false, |