diff --git a/CHANGELOG.md b/CHANGELOG.md index ea87a7f4d7..29bfaa8cbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Fixed - openssl vendoring broken on macos ([#772](https://github.com/extrawurst/gitui/issues/772)) +- amend and other commands not shown in help ([#778](https://github.com/extrawurst/gitui/issues/778)) ## [0.16.1] - 2021-06-06 diff --git a/src/components/branchlist.rs b/src/components/branchlist.rs index f2ba49ccfa..9b36840759 100644 --- a/src/components/branchlist.rs +++ b/src/components/branchlist.rs @@ -102,7 +102,9 @@ impl Component for BranchListComponent { force_all: bool, ) -> CommandBlocking { if self.visible || force_all { - out.clear(); + if !force_all { + out.clear(); + } out.push(CommandInfo::new( strings::commands::scroll(&self.key_config), diff --git a/src/components/cred.rs b/src/components/cred.rs index ea0abbf5e5..ecd277d4ca 100644 --- a/src/components/cred.rs +++ b/src/components/cred.rs @@ -80,22 +80,24 @@ impl Component for CredComponent { fn commands( &self, out: &mut Vec, - _force_all: bool, + force_all: bool, ) -> CommandBlocking { - if self.is_visible() { - out.clear(); - } + if self.is_visible() || force_all { + if !force_all { + out.clear(); + } - out.push(CommandInfo::new( - strings::commands::validate_msg(&self.key_config), - true, - self.visible, - )); - out.push(CommandInfo::new( - strings::commands::close_popup(&self.key_config), - true, - self.visible, - )); + out.push(CommandInfo::new( + strings::commands::validate_msg(&self.key_config), + true, + true, + )); + out.push(CommandInfo::new( + strings::commands::close_popup(&self.key_config), + true, + true, + )); + } visibility_blocking(self) } diff --git a/src/components/externaleditor.rs b/src/components/externaleditor.rs index d1db695c6c..94d3189f57 100644 --- a/src/components/externaleditor.rs +++ b/src/components/externaleditor.rs @@ -157,9 +157,9 @@ impl Component for ExternalEditorComponent { fn commands( &self, out: &mut Vec, - _force_all: bool, + force_all: bool, ) -> CommandBlocking { - if self.visible { + if self.visible && !force_all { out.clear(); } diff --git a/src/components/pull.rs b/src/components/pull.rs index 18c347716e..552a7eecc4 100644 --- a/src/components/pull.rs +++ b/src/components/pull.rs @@ -238,20 +238,22 @@ impl Component for PullComponent { out: &mut Vec, force_all: bool, ) -> CommandBlocking { - if self.is_visible() { - out.clear(); - } + if self.is_visible() || force_all { + if !force_all { + out.clear(); + } - if self.input_cred.is_visible() { - self.input_cred.commands(out, force_all) - } else { + if self.input_cred.is_visible() { + return self.input_cred.commands(out, force_all); + } out.push(CommandInfo::new( strings::commands::close_msg(&self.key_config), !self.pending, self.visible, )); - visibility_blocking(self) } + + visibility_blocking(self) } fn event(&mut self, ev: Event) -> Result { diff --git a/src/components/push.rs b/src/components/push.rs index 11d9ebbef7..3815538057 100644 --- a/src/components/push.rs +++ b/src/components/push.rs @@ -247,20 +247,22 @@ impl Component for PushComponent { out: &mut Vec, force_all: bool, ) -> CommandBlocking { - if self.is_visible() { - out.clear(); - } + if self.is_visible() || force_all { + if !force_all { + out.clear(); + } - if self.input_cred.is_visible() { - self.input_cred.commands(out, force_all) - } else { + if self.input_cred.is_visible() { + return self.input_cred.commands(out, force_all); + } out.push(CommandInfo::new( strings::commands::close_msg(&self.key_config), !self.pending, self.visible, )); - visibility_blocking(self) } + + visibility_blocking(self) } fn event(&mut self, ev: Event) -> Result { diff --git a/src/components/push_tags.rs b/src/components/push_tags.rs index f2c84207ad..79924c08c0 100644 --- a/src/components/push_tags.rs +++ b/src/components/push_tags.rs @@ -204,20 +204,22 @@ impl Component for PushTagsComponent { out: &mut Vec, force_all: bool, ) -> CommandBlocking { - if self.is_visible() { - out.clear(); - } + if self.is_visible() || force_all { + if !force_all { + out.clear(); + } + + if self.input_cred.is_visible() { + return self.input_cred.commands(out, force_all); + } - if self.input_cred.is_visible() { - self.input_cred.commands(out, force_all) - } else { out.push(CommandInfo::new( strings::commands::close_msg(&self.key_config), !self.pending, self.visible, )); - visibility_blocking(self) } + visibility_blocking(self) } fn event(&mut self, ev: Event) -> Result { diff --git a/src/components/taglist.rs b/src/components/taglist.rs index 48c411881d..d891028785 100644 --- a/src/components/taglist.rs +++ b/src/components/taglist.rs @@ -126,7 +126,9 @@ impl Component for TagListComponent { force_all: bool, ) -> CommandBlocking { if self.visible || force_all { - out.clear(); + if !force_all { + out.clear(); + } out.push(CommandInfo::new( strings::commands::scroll(&self.key_config), diff --git a/src/strings.rs b/src/strings.rs index ee57e7b6c0..48d707a587 100644 --- a/src/strings.rs +++ b/src/strings.rs @@ -308,6 +308,7 @@ pub mod commands { static CMD_GROUP_STASHING: &str = "-- Stashing --"; static CMD_GROUP_STASHES: &str = "-- Stashes --"; static CMD_GROUP_LOG: &str = "-- Log --"; + static CMD_GROUP_BRANCHES: &str = "-- Branches --"; pub fn toggle_tabs(key_config: &SharedKeyConfig) -> CommandText { CommandText::new( @@ -607,7 +608,7 @@ pub mod commands { "Open editor [{}]", key_config.get_hint(key_config.open_commit_editor), ), - "open commit editor (available in non-empty stage)", + "open commit editor (available in commit popup)", CMD_GROUP_COMMIT, ) } @@ -620,6 +621,7 @@ pub mod commands { "commit (available when commit message is non-empty)", CMD_GROUP_COMMIT, ) + .hide_help() } pub fn commit_amend(key_config: &SharedKeyConfig) -> CommandText { CommandText::new( @@ -627,7 +629,7 @@ pub mod commands { "Amend [{}]", key_config.get_hint(key_config.commit_amend), ), - "amend last commit", + "amend last commit (available in commit popup)", CMD_GROUP_COMMIT, ) } @@ -924,8 +926,9 @@ pub mod commands { key_config.get_hint(key_config.enter), ), "create branch", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) + .hide_help() } pub fn open_branch_create_popup( key_config: &SharedKeyConfig, @@ -936,7 +939,7 @@ pub mod commands { key_config.get_hint(key_config.create_branch), ), "open create branch popup", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) } pub fn rename_branch_confirm_msg( @@ -948,8 +951,9 @@ pub mod commands { key_config.get_hint(key_config.enter), ), "rename branch", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) + .hide_help() } pub fn rename_branch_popup( key_config: &SharedKeyConfig, @@ -960,7 +964,7 @@ pub mod commands { key_config.get_hint(key_config.rename_branch), ), "rename branch", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) } pub fn delete_branch_popup( @@ -972,7 +976,7 @@ pub mod commands { key_config.get_hint(key_config.delete_branch), ), "delete a branch", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) } pub fn merge_branch_popup( @@ -984,7 +988,7 @@ pub mod commands { key_config.get_hint(key_config.merge_branch), ), "merge a branch", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) } pub fn select_branch_popup( @@ -996,7 +1000,7 @@ pub mod commands { key_config.get_hint(key_config.enter), ), "checkout branch", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) } pub fn toggle_branch_popup( @@ -1010,7 +1014,7 @@ pub mod commands { key_config.get_hint(key_config.tab_toggle), ), "toggle branch type (remote/local)", - CMD_GROUP_GENERAL, + CMD_GROUP_BRANCHES, ) } pub fn open_branch_select_popup( @@ -1021,8 +1025,8 @@ pub mod commands { "Branches [{}]", key_config.get_hint(key_config.select_branch), ), - "open select branch popup", - CMD_GROUP_GENERAL, + "open branch popup", + CMD_GROUP_BRANCHES, ) } @@ -1057,7 +1061,7 @@ pub mod commands { key_config.get_hint(key_config.select_tag), ), "Select commit in revlog", - CMD_GROUP_GENERAL, + CMD_GROUP_LOG, ) }