summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormartihomssoler <martihomssoler@gmail.com>2024-03-20 18:02:59 +0100
committerextrawurst <776816+extrawurst@users.noreply.github.com>2024-03-22 12:13:14 -0700
commitf40d36806909742af5fbedc939e2f1cab29ea7b8 (patch)
tree46be6b594e8b166bff302836bb9a4a6cb1387a22 /src
parentb7b7705df2e643b9aab44362c95b8fd606e7efd4 (diff)
fix: 2114
Diffstat (limited to 'src')
-rw-r--r--src/popups/inspect_commit.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/popups/inspect_commit.rs b/src/popups/inspect_commit.rs
index 42c95dd2..7ce1aced 100644
--- a/src/popups/inspect_commit.rs
+++ b/src/popups/inspect_commit.rs
@@ -23,6 +23,8 @@ use ratatui::{
Frame,
};
+use super::FileTreeOpen;
+
#[derive(Clone, Debug)]
pub struct InspectCommitOpen {
pub commit_id: CommitId,
@@ -169,6 +171,24 @@ impl Component for InspectCommitPopup {
} else if key_match(e, self.key_config.keys.move_left)
{
self.hide_stacked(false);
+ } else if key_match(
+ e,
+ self.key_config.keys.open_file_tree,
+ ) {
+ if let Some(commit_id) = self
+ .open_request
+ .as_ref()
+ .map(|open_commit| open_commit.commit_id)
+ {
+ self.hide_stacked(true);
+ self.queue.push(InternalEvent::OpenPopup(
+ StackablePopupOpen::FileTree(
+ FileTreeOpen::new(commit_id),
+ ),
+ ));
+ return Ok(EventState::Consumed);
+ }
+ return Ok(EventState::NotConsumed);
}
return Ok(EventState::Consumed);