diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-13 02:53:20 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-13 02:53:20 -0500 |
commit | 40a943a422623f0533fbac40285164709b86b5a0 (patch) | |
tree | 0c54e839bd039c679a9e7f86d1cc480408c2b37f /src | |
parent | 12fdef8b2965dde7380049e82ae20f33129d5a82 (diff) | |
download | nbsh-40a943a422623f0533fbac40285164709b86b5a0.tar.gz nbsh-40a943a422623f0533fbac40285164709b86b5a0.zip |
more rearranging
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 2 | ||||
-rw-r--r-- | src/state/history.rs (renamed from src/history.rs) | 0 | ||||
-rw-r--r-- | src/state/mod.rs (renamed from src/state.rs) | 15 | ||||
-rw-r--r-- | src/state/readline.rs (renamed from src/readline.rs) | 0 |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 24e59ee..22af8ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,9 +11,7 @@ mod builtins; mod env; mod event; mod format; -mod history; mod parse; -mod readline; mod state; mod util; diff --git a/src/history.rs b/src/state/history.rs index 048c1c7..048c1c7 100644 --- a/src/history.rs +++ b/src/state/history.rs diff --git a/src/state.rs b/src/state/mod.rs index cdc3cdb..2fcaf3f 100644 --- a/src/state.rs +++ b/src/state/mod.rs @@ -1,3 +1,6 @@ +mod history; +mod readline; + #[derive(Copy, Clone, Debug)] enum Focus { Readline, @@ -19,8 +22,8 @@ pub enum Action { } pub struct State { - readline: crate::readline::Readline, - history: crate::history::History, + readline: readline::Readline, + history: history::History, focus: Focus, scene: Scene, escape: bool, @@ -31,8 +34,8 @@ pub struct State { impl State { pub fn new(offset: time::UtcOffset) -> Self { Self { - readline: crate::readline::Readline::new(), - history: crate::history::History::new(), + readline: readline::Readline::new(), + history: history::History::new(), focus: Focus::Readline, scene: Scene::Readline, escape: false, @@ -340,7 +343,7 @@ impl State { async fn default_scene( &self, focus: Focus, - entry: Option<async_std::sync::MutexGuardArc<crate::history::Entry>>, + entry: Option<async_std::sync::MutexGuardArc<history::Entry>>, ) -> Scene { match focus { Focus::Readline | Focus::Scrolling(_) => Scene::Readline, @@ -362,7 +365,7 @@ impl State { async fn set_focus( &mut self, new_focus: Focus, - entry: Option<async_std::sync::MutexGuardArc<crate::history::Entry>>, + entry: Option<async_std::sync::MutexGuardArc<history::Entry>>, ) { self.focus = new_focus; self.hide_readline = false; diff --git a/src/readline.rs b/src/state/readline.rs index 585d6b6..585d6b6 100644 --- a/src/readline.rs +++ b/src/state/readline.rs |