diff options
author | rabite <rabite@posteo.de> | 2020-01-22 14:16:36 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2020-01-22 14:16:36 +0100 |
commit | 8c23d058ade48d9af84a67a1c2225f8309e4827c (patch) | |
tree | 7695b775b5d519c5ebf7019cbf52f13ebb4b98c4 | |
parent | 7583e0a16e541a72cd87020414cdc53eddc958f6 (diff) |
fix crash when "running" first section in actions
-rw-r--r-- | src/quick_actions.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick_actions.rs b/src/quick_actions.rs index 58eaff8..8f7fa24 100644 --- a/src/quick_actions.rs +++ b/src/quick_actions.rs @@ -160,10 +160,16 @@ impl ListView<Vec<QuickActions>> { let selection = self.get_selection(); let selected_action_index = selection - fold_start_pos; + // Fixes crash when "running" first description and nicer to use + if self.is_description_selected() { + self.toggle_fold()?; + return Ok(()); + } + self.content[current_fold] .actions // -1 because fold description takes one slot - .get()?[selected_action_index-1] + .get()?[selected_action_index - 1] .run(self.content[0].files.clone(), &self.core, self.content[0].proc_view.clone())?; |