summaryrefslogtreecommitdiffstats
path: root/src/event/action_map.rs
diff options
context:
space:
mode:
authorqkzk <qkzk@users.noreply.github.com>2024-01-10 20:37:07 +0100
committerGitHub <noreply@github.com>2024-01-10 20:37:07 +0100
commit0c669840cac86bdf59074d643d56a6ff3554c3cd (patch)
treee27577b68401036af6f12418d4381d9f232fd99d /src/event/action_map.rs
parent1df94a5fe4fb781b6d207bc35759348b3d8ad86a (diff)
parentfa7fae1fbd318988f75d97a45d49a5228254007b (diff)
Merge pull request #87 from qkzk/v0.1.25-devv0.1.25
V0.1.25 dev
Diffstat (limited to 'src/event/action_map.rs')
-rw-r--r--src/event/action_map.rs54
1 files changed, 31 insertions, 23 deletions
diff --git a/src/event/action_map.rs b/src/event/action_map.rs
index 9a15485..a64f28d 100644
--- a/src/event/action_map.rs
+++ b/src/event/action_map.rs
@@ -12,14 +12,15 @@ use crate::modes::LeaveMode;
/// actions in the application.
#[derive(Clone, Debug, Display, EnumString, EnumIter)]
pub enum ActionMap {
+ Action,
Back,
BackTab,
Backspace,
Bulk,
+ Cd,
Chmod,
ClearFlags,
CliMenu,
- Command,
Compress,
Context,
CopyFilename,
@@ -28,7 +29,7 @@ pub enum ActionMap {
CutPaste,
Delete,
DeleteFile,
- Ncdu,
+ DisplayFlagged,
EncryptedDrive,
End,
Enter,
@@ -40,7 +41,6 @@ pub enum ActionMap {
FuzzyFindLine,
GoRoot,
GoStart,
- Goto,
Help,
History,
Home,
@@ -60,6 +60,8 @@ pub enum ActionMap {
MoveLeft,
MoveRight,
MoveUp,
+ Ncdu,
+ NextSibling,
NewDir,
NewFile,
Nothing,
@@ -67,9 +69,11 @@ pub enum ActionMap {
NvimSetAddress,
OpenConfig,
OpenFile,
+ OpenAll,
PageDown,
PageUp,
Preview,
+ PreviousSibling,
Quit,
RefreshIfNeeded,
RefreshView,
@@ -110,44 +114,44 @@ impl ActionMap {
pub fn matcher(&self, status: &mut Status, binds: &Bindings) -> Result<()> {
let current_tab = status.current_tab_mut();
match self {
- Self::Back => EventAction::back(current_tab),
+ Self::Action => EventAction::action(status),
+ Self::Back => EventAction::back(status),
Self::BackTab => EventAction::backtab(status),
Self::Backspace => EventAction::backspace(status),
Self::Bulk => EventAction::bulk(status),
Self::Chmod => EventAction::chmod(status),
Self::ClearFlags => EventAction::clear_flags(status),
Self::CliMenu => EventAction::cli_menu(status),
- Self::Command => EventAction::command(status),
Self::Compress => EventAction::compress(status),
Self::Context => EventAction::context(status),
- Self::CopyFilename => EventAction::copy_filename(current_tab),
- Self::CopyFilepath => EventAction::copy_filepath(current_tab),
+ Self::CopyFilename => EventAction::copy_filename(status),
+ Self::CopyFilepath => EventAction::copy_filepath(status),
Self::CopyPaste => EventAction::copy_paste(status),
Self::CutPaste => EventAction::cut_paste(status),
Self::Delete => EventAction::delete(status),
Self::DeleteFile => EventAction::delete_file(status),
- Self::Ncdu => EventAction::ncdu(status),
+ Self::DisplayFlagged => EventAction::display_flagged(status),
Self::EncryptedDrive => EventAction::encrypted_drive(status),
Self::End => EventAction::end(status),
Self::Enter => EventAction::enter(status, binds),
- Self::Exec => EventAction::exec(current_tab),
- Self::Filter => EventAction::filter(current_tab),
+ Self::Exec => EventAction::exec(status),
+ Self::Filter => EventAction::filter(status),
Self::FlagAll => EventAction::flag_all(status),
Self::FuzzyFind => EventAction::fuzzyfind(status),
Self::FuzzyFindHelp => EventAction::fuzzyfind_help(status, binds),
Self::FuzzyFindLine => EventAction::fuzzyfind_line(status),
Self::GoRoot => EventAction::go_root(status),
Self::GoStart => EventAction::go_start(status),
- Self::Goto => EventAction::goto(status),
+ Self::Cd => EventAction::cd(status),
Self::Help => EventAction::help(status, binds),
- Self::History => EventAction::history(current_tab),
+ Self::History => EventAction::history(status),
Self::Home => EventAction::home(status),
Self::Jump => EventAction::jump(status),
Self::KeyHome => EventAction::key_home(status),
Self::Log => EventAction::log(current_tab),
Self::LazyGit => EventAction::lazygit(status),
Self::MarksJump => EventAction::marks_jump(status),
- Self::MarksNew => EventAction::marks_new(current_tab),
+ Self::MarksNew => EventAction::marks_new(status),
Self::MocpAddToPlayList => EventAction::mocp_add_to_playlist(current_tab),
Self::MocpClearPlaylist => EventAction::mocp_clear_playlist(),
Self::MocpGoToSong => EventAction::mocp_go_to_song(status),
@@ -158,30 +162,34 @@ impl ActionMap {
Self::MoveLeft => EventAction::move_left(status),
Self::MoveRight => EventAction::move_right(status),
Self::MoveUp => EventAction::move_up(status),
- Self::NewDir => EventAction::new_dir(current_tab),
- Self::NewFile => EventAction::new_file(current_tab),
+ Self::NextSibling => EventAction::next_sibling(current_tab),
+ Self::Ncdu => EventAction::ncdu(status),
+ Self::NewDir => EventAction::new_dir(status),
+ Self::NewFile => EventAction::new_file(status),
Self::NvimFilepicker => EventAction::nvim_filepicker(status),
- Self::NvimSetAddress => EventAction::set_nvim_server(current_tab),
+ Self::NvimSetAddress => EventAction::set_nvim_server(status),
Self::OpenConfig => EventAction::open_config(status),
Self::OpenFile => EventAction::open_file(status),
+ Self::OpenAll => EventAction::open_all(status),
Self::PageDown => EventAction::page_down(status),
Self::PageUp => EventAction::page_up(status),
Self::Preview => EventAction::preview(current_tab),
+ Self::PreviousSibling => EventAction::previous_sibling(current_tab),
Self::Quit => EventAction::quit(status),
Self::RefreshIfNeeded => EventAction::refresh_if_needed(current_tab),
Self::RefreshView => EventAction::refresh_view(status),
- Self::RegexMatch => EventAction::regex_match(current_tab),
- Self::RemoteMount => EventAction::remote_mount(current_tab),
+ Self::RegexMatch => EventAction::regex_match(status),
+ Self::RemoteMount => EventAction::remote_mount(status),
Self::RemovableDevices => EventAction::removable_devices(status),
Self::Rename => EventAction::rename(status),
Self::ResetMode => EventAction::reset_mode(status),
Self::ReverseFlags => EventAction::reverse_flags(status),
- Self::Search => EventAction::search(current_tab),
+ Self::Search => EventAction::search(status),
Self::SearchNext => EventAction::search_next(status),
Self::Shell => EventAction::shell(status),
- Self::ShellCommand => EventAction::shell_command(current_tab),
+ Self::ShellCommand => EventAction::shell_command(status),
Self::Shortcut => EventAction::shortcut(status),
- Self::Sort => EventAction::sort(current_tab),
+ Self::Sort => EventAction::sort(status),
Self::Symlink => EventAction::symlink(status),
Self::Tab => EventAction::tab(status),
Self::ToggleDisplayFull => EventAction::toggle_display_full(status),
@@ -193,11 +201,11 @@ impl ActionMap {
Self::TrashMoveFile => EventAction::trash_move_file(status),
Self::TrashOpen => EventAction::trash_open(status),
Self::TrashRestoreFile => LeaveMode::trash(status),
- Self::Tree => EventAction::tree(current_tab),
+ Self::Tree => EventAction::tree(status),
Self::TreeFold => EventAction::tree_fold(current_tab),
Self::TreeFoldAll => EventAction::tree_fold_all(current_tab),
Self::TreeUnFoldAll => EventAction::tree_unfold_all(current_tab),
- Self::TuiMenu => EventAction::tui_menu(current_tab),
+ Self::TuiMenu => EventAction::tui_menu(status),
Self::Custom(string) => EventAction::custom(status, string),
Self::Nothing => Ok(()),