diff options
author | qkzk <qu3nt1n@gmail.com> | 2022-10-22 14:32:13 +0200 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2022-10-22 14:32:13 +0200 |
commit | 3f98c781874ebcc92fd7dde0bbb139ed4f79695b (patch) | |
tree | 0a7206a0b11464af4f2658dc31f6f5f69d47f071 /src/actioner.rs | |
parent | d305dafd8c2de84d795e4acb2c25c269a8fe832d (diff) |
refactored fileinfo, moved most of unwrap to eventchar & actioner
Diffstat (limited to 'src/actioner.rs')
-rw-r--r-- | src/actioner.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/actioner.rs b/src/actioner.rs index d2eef91..8743ec0 100644 --- a/src/actioner.rs +++ b/src/actioner.rs @@ -88,7 +88,7 @@ impl Actioner { /// Leaving a mode reset the window fn escape(&self, tabs: &mut Status) { - tabs.selected().event_normal() + tabs.selected().event_normal().unwrap_or_default(); } /// Move one line up @@ -122,7 +122,7 @@ impl Actioner { /// Move left in a string, move to parent in normal mode fn left(&self, tabs: &mut Status) { match tabs.selected().mode { - Mode::Normal => tabs.selected().event_move_to_parent(), + Mode::Normal => tabs.selected().event_move_to_parent().unwrap_or_default(), Mode::Rename | Mode::Chmod | Mode::Newdir @@ -230,9 +230,9 @@ impl Actioner { Mode::Search => tabs.selected().exec_search(), Mode::Goto => tabs.selected().exec_goto()?, Mode::RegexMatch => tabs.exec_regex()?, - Mode::Jump => tabs.exec_jump(), + Mode::Jump => tabs.exec_jump()?, Mode::History => tabs.selected().exec_history()?, - Mode::Shortcut => tabs.selected().exec_shortcut(), + Mode::Shortcut => tabs.selected().exec_shortcut()?, Mode::Normal | Mode::NeedConfirmation | Mode::Help @@ -292,7 +292,9 @@ impl Actioner { Some(event_char) => event_char.match_char(tabs), None => (), }, - Mode::Help | Mode::Preview | Mode::Shortcut => tabs.selected().event_normal(), + Mode::Help | Mode::Preview | Mode::Shortcut => { + tabs.selected().event_normal().unwrap_or_default() + } Mode::Jump => (), Mode::History => (), Mode::NeedConfirmation => { @@ -301,8 +303,8 @@ impl Actioner { } tabs.selected().event_leave_need_confirmation() } - Mode::Marks(MarkAction::Jump) => tabs.exec_marks_jump(c), - Mode::Marks(MarkAction::New) => tabs.exec_marks_new(c), + Mode::Marks(MarkAction::Jump) => tabs.exec_marks_jump(c).unwrap_or_default(), + Mode::Marks(MarkAction::New) => tabs.exec_marks_new(c).unwrap_or_default(), Mode::Sort => tabs.selected().event_leave_sort(c), } } |