sketch out zz, plan other modes

This commit is contained in:
alice pellerin
2026-03-17 04:49:47 -05:00
parent 9eeeca9034
commit 999964abde
2 changed files with 18 additions and 3 deletions
+12 -2
View File
@@ -26,7 +26,7 @@ pub enum Mode {
#[derive(Debug)]
pub enum PartialAction {
Goto, Zview
Goto, Zview, Replace
}
impl Mode {
@@ -52,6 +52,7 @@ impl PartialAction {
match self {
Self::Goto => "g",
Self::Zview => "z",
Self::Replace => "r",
}
}
}
@@ -193,6 +194,16 @@ impl App {
self.clamp_screen_to_cursor();
}
(Mode::Normal, Event::Key(key_event), None)
if key_event.code == KeyCode::Char('z') => {
self.partial_action = Some(PartialAction::Zview);
}
(Mode::Normal, Event::Key(key_event), Some(PartialAction::Zview))
if key_event.code == KeyCode::Char('z') => {
self.partial_action = None;
}
(Mode::Normal, Event::Key(key_event), None)
if key_event.code == KeyCode::Char('i') ||
key_event.code == KeyCode::Up => {
@@ -278,7 +289,6 @@ impl App {
}
(Mode::Normal, Event::Key(_), Some(_)) => {
self.logs.push("key press!".to_string());
self.partial_action = None;
}