Skip to content

Commit

Permalink
fix: Better name Action variants for home mode 🐛 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak authored Jan 7, 2024
1 parent 5a37246 commit 0a00d95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions async/ratatui-counter/src/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub enum Action {
EnterInsert,
EnterProcessing,
ExitProcessing,
EnterHomeInput,
EnterHomeNormal,
EnterModeHomeInput,
EnterModeHomeNormal,
Update,
}
//// ANCHOR_END: action_enum
4 changes: 2 additions & 2 deletions async/ratatui-counter/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
4 changes: 2 additions & 2 deletions async/ratatui-counter/src/components/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a00d95

Please sign in to comment.