show tab button in help and fix help for diff (fixes #48)

This commit is contained in:
Stephan Dilly 2020-05-10 14:37:15 +02:00
parent 5f08bd61e6
commit 7e8e3a0bd5
3 changed files with 22 additions and 8 deletions

View file

@ -415,6 +415,15 @@ impl App {
);
}
res.push(
CommandInfo::new(
commands::TOGGLE_TABS,
true,
!self.any_popup_visible(),
)
.hidden(),
);
res.push(
CommandInfo::new(
commands::QUIT,

View file

@ -350,16 +350,15 @@ impl Component for DiffComponent {
.hidden(),
);
let cmd_text = if self.current.is_stage {
commands::DIFF_HUNK_REMOVE
} else {
commands::DIFF_HUNK_ADD
};
out.push(CommandInfo::new(
cmd_text,
commands::DIFF_HUNK_REMOVE,
self.selected_hunk.is_some(),
self.focused,
self.focused && self.current.is_stage,
));
out.push(CommandInfo::new(
commands::DIFF_HUNK_ADD,
self.selected_hunk.is_some(),
self.focused && !self.current.is_stage,
));
CommandBlocking::PassingOn

View file

@ -24,6 +24,12 @@ pub mod commands {
static CMD_GROUP_CHANGES: &str = "Changes";
static CMD_GROUP_COMMIT: &str = "Commit";
///
pub static TOGGLE_TABS: CommandText = CommandText::new(
"Tabs [tabs]",
"switch top level tabs",
CMD_GROUP_GENERAL,
);
///
pub static HELP_OPEN: CommandText = CommandText::new(
"Help [h]",