From 0a00d95f9c32475cbed50f5a0472c1486336e715 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sat, 6 Jan 2024 22:31:42 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20Better=20name=20Action=20variants=20for?= =?UTF-8?q?=20home=20mode=20=F0=9F=90=9B=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- async/ratatui-counter/src/action.rs | 4 ++-- async/ratatui-counter/src/app.rs | 4 ++-- async/ratatui-counter/src/components/home.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/async/ratatui-counter/src/action.rs b/async/ratatui-counter/src/action.rs index 251d5d1..0a7a38f 100644 --- a/async/ratatui-counter/src/action.rs +++ b/async/ratatui-counter/src/action.rs @@ -28,8 +28,8 @@ pub enum Action { EnterInsert, EnterProcessing, ExitProcessing, - EnterHomeInput, - EnterHomeNormal, + EnterModeHomeInput, + EnterModeHomeNormal, Update, } //// ANCHOR_END: action_enum diff --git a/async/ratatui-counter/src/app.rs b/async/ratatui-counter/src/app.rs index fb60330..2dd89e1 100644 --- a/async/ratatui-counter/src/app.rs +++ b/async/ratatui-counter/src/app.rs @@ -104,8 +104,8 @@ impl App { Action::Quit => self.should_quit = true, Action::Suspend => self.should_suspend = true, Action::Resume => self.should_suspend = false, - Action::EnterHomeInput => self.mode = Mode::HomeInput, - Action::EnterHomeNormal => self.mode = Mode::Home, + Action::EnterModeHomeInput => self.mode = Mode::HomeInput, + Action::EnterModeHomeNormal => self.mode = Mode::Home, Action::Resize(w, h) => { tui.resize(Rect::new(0, 0, w, h))?; tui.draw(|f| { diff --git a/async/ratatui-counter/src/components/home.rs b/async/ratatui-counter/src/components/home.rs index 4713aab..3d65cf3 100644 --- a/async/ratatui-counter/src/components/home.rs +++ b/async/ratatui-counter/src/components/home.rs @@ -265,11 +265,11 @@ impl Component for Home { Action::CompleteInput(s) => self.add(s), Action::EnterNormal => { self.mode = Mode::Normal; - return Ok(Some(Action::EnterHomeNormal)); + return Ok(Some(Action::EnterModeHomeNormal)); }, Action::EnterInsert => { self.mode = Mode::Insert; - return Ok(Some(Action::EnterHomeInput)); + return Ok(Some(Action::EnterModeHomeInput)); }, Action::EnterProcessing => { self.mode = Mode::Processing;