From e5c62d01e120983e9dda10325522eac83f381b10 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Fri, 30 Dec 2022 00:15:13 +0100 Subject: [PATCH] remove duplicate `edit` cmd from bar (#1489) --- CHANGELOG.md | 1 + src/tabs/status.rs | 28 ++-------------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad819965..503dd7b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `--bugreport` does not require param ([#1466](https://github.com/extrawurst/gitui/issues/1466)) * `edit`-file command shown on commits msg ([#1461](https://github.com/extrawurst/gitui/issues/1461)) * crash on branches popup in small terminal ([#1470](https://github.com/extrawurst/gitui/issues/1470)) +* `edit` command duplication ([#1489](https://github.com/extrawurst/gitui/issues/1489)) ## [0.22.1] - 2022-11-22 diff --git a/src/tabs/status.rs b/src/tabs/status.rs index cd544b4b..b7b3d599 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -805,19 +805,7 @@ impl Component for Status { )); } - { - out.push(CommandInfo::new( - strings::commands::edit_item(&self.key_config), - if focus_on_diff { - true - } else { - self.can_focus_diff() - }, - self.visible || force_all, - )); - - self.commands_nav(out, force_all); - } + self.commands_nav(out, force_all); visibility_blocking(self) } @@ -836,19 +824,7 @@ impl Component for Status { } if let Event::Key(k) = ev { - return if key_match(k, self.key_config.keys.edit_file) - && (self.can_focus_diff() - || self.is_focus_on_diff()) - { - if let Some((path, _)) = self.selected_path() { - self.queue.push( - InternalEvent::OpenExternalEditor(Some( - path, - )), - ); - } - Ok(EventState::Consumed) - } else if key_match( + return if key_match( k, self.key_config.keys.open_commit, ) && self.can_commit()