sketch out zz, plan other modes
This commit is contained in:
+12
-2
@@ -26,7 +26,7 @@ pub enum Mode {
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum PartialAction {
|
pub enum PartialAction {
|
||||||
Goto, Zview
|
Goto, Zview, Replace
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Mode {
|
impl Mode {
|
||||||
@@ -52,6 +52,7 @@ impl PartialAction {
|
|||||||
match self {
|
match self {
|
||||||
Self::Goto => "g",
|
Self::Goto => "g",
|
||||||
Self::Zview => "z",
|
Self::Zview => "z",
|
||||||
|
Self::Replace => "r",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,6 +194,16 @@ impl App {
|
|||||||
self.clamp_screen_to_cursor();
|
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)
|
(Mode::Normal, Event::Key(key_event), None)
|
||||||
if key_event.code == KeyCode::Char('i') ||
|
if key_event.code == KeyCode::Char('i') ||
|
||||||
key_event.code == KeyCode::Up => {
|
key_event.code == KeyCode::Up => {
|
||||||
@@ -278,7 +289,6 @@ impl App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(Mode::Normal, Event::Key(_), Some(_)) => {
|
(Mode::Normal, Event::Key(_), Some(_)) => {
|
||||||
self.logs.push("key press!".to_string());
|
|
||||||
self.partial_action = None;
|
self.partial_action = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -15,13 +15,18 @@ const CHUNKS_PER_LINE: usize = BYTES_PER_LINE / BYTES_PER_CHUNK;
|
|||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// - modes
|
// - modes
|
||||||
// - g/v/z
|
// - select
|
||||||
|
// - insert
|
||||||
|
// - zz/zt/zb
|
||||||
// - search
|
// - search
|
||||||
// - jumplist
|
// - jumplist
|
||||||
// - modifications
|
// - modifications
|
||||||
// - insert/append
|
// - insert/append
|
||||||
|
// - mode
|
||||||
// - replace
|
// - replace
|
||||||
|
// - partial action
|
||||||
// - replace-and-keep-going
|
// - replace-and-keep-going
|
||||||
|
// - mode
|
||||||
// - delete
|
// - delete
|
||||||
// - change
|
// - change
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user