diff --git a/CHANGELOG.md b/CHANGELOG.md index b566c95ea0..f711059eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * display current repository path in the top-right corner [[@alexmaco](https://github.com/alexmaco)]([#1387](https://github.com/extrawurst/gitui/pull/1387)) * add Linux targets for ARM, ARMv7 and AARCH64 [[@adur1990](https://github.com/adur1990)] ([#1419](https://github.com/extrawurst/gitui/pull/1419)) * display commit description in file view [[@alexmaco](https://github.com/alexmaco)] ([#1380](https://github.com/extrawurst/gitui/pull/1380)) +* allow launching editor from Compare Commits view ([#1409](https://github.com/extrawurst/gitui/pull/1409)) ### Fixes * remove insecure dependency `ansi_term` ([#1290](https://github.com/extrawurst/gitui/issues/1290)) diff --git a/src/components/inspect_commit.rs b/src/components/inspect_commit.rs index 4caa052da3..aa340dd56b 100644 --- a/src/components/inspect_commit.rs +++ b/src/components/inspect_commit.rs @@ -138,6 +138,12 @@ impl Component for InspectCommitComponent { true, true, )); + + out.push(CommandInfo::new( + strings::commands::edit_item(&self.key_config), + true, + true, + )); } visibility_blocking(self) diff --git a/src/components/status_tree.rs b/src/components/status_tree.rs index 6b5a25f208..122720706c 100644 --- a/src/components/status_tree.rs +++ b/src/components/status_tree.rs @@ -419,6 +419,14 @@ impl Component for StatusTreeComponent { ) .order(order::RARE_ACTION), ); + out.push( + CommandInfo::new( + strings::commands::edit_item(&self.key_config), + self.selection_file().is_some(), + self.focused || force_all, + ) + .order(order::RARE_ACTION), + ); CommandBlocking::PassingOn } @@ -459,6 +467,18 @@ impl Component for StatusTreeComponent { } } Ok(EventState::Consumed) + } else if key_match(e, self.key_config.keys.edit_file) + { + if let Some(status_item) = self.selection_file() { + if let Some(queue) = &self.queue { + queue.push( + InternalEvent::OpenExternalEditor( + Some(status_item.path), + ), + ); + } + } + Ok(EventState::Consumed) } else if key_match(e, self.key_config.keys.move_down) { Ok(self