Skip to content

popups clear help commands #779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion src/components/branchlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
30 changes: 16 additions & 14 deletions src/components/cred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,24 @@ impl Component for CredComponent {
fn commands(
&self,
out: &mut Vec<CommandInfo>,
_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)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/externaleditor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ impl Component for ExternalEditorComponent {
fn commands(
&self,
out: &mut Vec<CommandInfo>,
_force_all: bool,
force_all: bool,
) -> CommandBlocking {
if self.visible {
if self.visible && !force_all {
out.clear();
}

Expand Down
16 changes: 9 additions & 7 deletions src/components/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,22 @@ impl Component for PullComponent {
out: &mut Vec<CommandInfo>,
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<EventState> {
Expand Down
16 changes: 9 additions & 7 deletions src/components/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,22 @@ impl Component for PushComponent {
out: &mut Vec<CommandInfo>,
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<EventState> {
Expand Down
16 changes: 9 additions & 7 deletions src/components/push_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,22 @@ impl Component for PushTagsComponent {
out: &mut Vec<CommandInfo>,
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<EventState> {
Expand Down
4 changes: 3 additions & 1 deletion src/components/taglist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
30 changes: 17 additions & 13 deletions src/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
)
}
Expand All @@ -620,14 +621,15 @@ 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(
format!(
"Amend [{}]",
key_config.get_hint(key_config.commit_amend),
),
"amend last commit",
"amend last commit (available in commit popup)",
CMD_GROUP_COMMIT,
)
}
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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,
)
}

Expand Down Expand Up @@ -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,
)
}

Expand Down