feat: implement command mode

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-05-09 00:15:42 +02:00
parent 445a628ff5
commit ed5a5db7c5
8 changed files with 405 additions and 57 deletions

View File

@@ -1,3 +1,5 @@
use crate::commands::{Command, IntoCommand};
#[derive(Debug)]
pub enum Msg {
MoveRight,
@@ -7,10 +9,20 @@ pub enum Msg {
OpenCreateItemDialog,
EnterInsertMode,
EnterViewMode,
EnterCommandMode,
SubmitCommand,
Edit(EditMsg),
}
impl IntoCommand for Msg {
fn into_command(self) -> crate::commands::Command {
Command::new(|| Some(self))
}
}
#[derive(Debug)]
pub enum EditMsg {
Delete,