diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-10 02:26:34 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-10 02:26:34 -0500 |
commit | 179ac31a1957f01b7ce023743a7cc4f9d520567d (patch) | |
tree | b0505f5fa2fe0c07977372aa224faf7b21786a4e /src/action.rs | |
parent | 1729d8988a12a097859697f6a9d8041f3a9763fa (diff) | |
download | nbsh-179ac31a1957f01b7ce023743a7cc4f9d520567d.tar.gz nbsh-179ac31a1957f01b7ce023743a7cc4f9d520567d.zip |
move some stuff around
Diffstat (limited to 'src/action.rs')
-rw-r--r-- | src/action.rs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/action.rs b/src/action.rs index 1c6f2f3..2473b35 100644 --- a/src/action.rs +++ b/src/action.rs @@ -3,13 +3,26 @@ pub enum Action { Render, ForceRedraw, Run(String), - UpdateFocus(crate::state::Focus), - UpdateScene(crate::state::Scene), + UpdateFocus(Focus), + UpdateScene(Scene), CheckUpdateScene, Resize((u16, u16)), Quit, } +#[derive(Copy, Clone, Debug)] +pub enum Focus { + Readline, + History(usize), + Scrolling(Option<usize>), +} + +#[derive(Copy, Clone, Debug)] +pub enum Scene { + Readline, + Fullscreen, +} + pub struct Reader { pending: async_std::sync::Mutex<Pending>, cvar: async_std::sync::Condvar, @@ -57,8 +70,8 @@ struct Pending { render: Option<()>, force_redraw: Option<()>, run: std::collections::VecDeque<String>, - focus: Option<crate::state::Focus>, - scene: Option<crate::state::Scene>, + focus: Option<Focus>, + scene: Option<Scene>, check_scene: Option<()>, size: Option<(u16, u16)>, done: bool, |