Skip to content

Commit

Permalink
Merge branch 'master' into #3-stashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed May 19, 2020
2 parents 7071456 + e73cdb6 commit 94a421b
Showing 1 changed file with 50 additions and 48 deletions.
98 changes: 50 additions & 48 deletions src/tabs/status.rs
Expand Up @@ -246,59 +246,61 @@ impl Component for Status {
out: &mut Vec<CommandInfo>,
force_all: bool,
) -> CommandBlocking {
for c in self.components() {
if c.commands(out, force_all)
!= CommandBlocking::PassingOn
&& !force_all
if self.visible {
for c in self.components() {
if c.commands(out, force_all)
!= CommandBlocking::PassingOn
&& !force_all
{
break;
}
}

{
break;
let focus_on_diff = self.focus == Focus::Diff;
out.push(CommandInfo::new(
commands::STATUS_FOCUS_LEFT,
true,
(self.visible && focus_on_diff) || force_all,
));
out.push(CommandInfo::new(
commands::STATUS_FOCUS_RIGHT,
self.can_focus_diff(),
(self.visible && !focus_on_diff) || force_all,
));
}
}

{
let focus_on_diff = self.focus == Focus::Diff;
out.push(CommandInfo::new(
commands::STATUS_FOCUS_LEFT,
true,
(self.visible && focus_on_diff) || force_all,
));
out.push(CommandInfo::new(
commands::STATUS_FOCUS_RIGHT,
self.can_focus_diff(),
(self.visible && !focus_on_diff) || force_all,
));
out.push(
CommandInfo::new(
commands::SELECT_STATUS,
true,
(self.visible && self.focus == Focus::Diff)
|| force_all,
)
.hidden(),
);

out.push(
CommandInfo::new(
commands::SELECT_STAGING,
true,
(self.visible && self.focus == Focus::WorkDir)
|| force_all,
)
.order(-2),
);

out.push(
CommandInfo::new(
commands::SELECT_UNSTAGED,
true,
(self.visible && self.focus == Focus::Stage)
|| force_all,
)
.order(-2),
);
}

out.push(
CommandInfo::new(
commands::SELECT_STATUS,
true,
(self.visible && self.focus == Focus::Diff)
|| force_all,
)
.hidden(),
);

out.push(
CommandInfo::new(
commands::SELECT_STAGING,
true,
(self.visible && self.focus == Focus::WorkDir)
|| force_all,
)
.order(-2),
);

out.push(
CommandInfo::new(
commands::SELECT_UNSTAGED,
true,
(self.visible && self.focus == Focus::Stage)
|| force_all,
)
.order(-2),
);

if self.visible {
CommandBlocking::Blocking
} else {
Expand Down

0 comments on commit 94a421b

Please sign in to comment.