Skip to content

Commit 94a421b

Browse files
author
Stephan Dilly
committed
Merge branch 'master' into #3-stashing
2 parents 7071456 + e73cdb6 commit 94a421b

File tree

1 file changed

+50
-48
lines changed

1 file changed

+50
-48
lines changed

src/tabs/status.rs

+50-48
Original file line numberDiff line numberDiff line change
@@ -246,59 +246,61 @@ impl Component for Status {
246246
out: &mut Vec<CommandInfo>,
247247
force_all: bool,
248248
) -> CommandBlocking {
249-
for c in self.components() {
250-
if c.commands(out, force_all)
251-
!= CommandBlocking::PassingOn
252-
&& !force_all
249+
if self.visible {
250+
for c in self.components() {
251+
if c.commands(out, force_all)
252+
!= CommandBlocking::PassingOn
253+
&& !force_all
254+
{
255+
break;
256+
}
257+
}
258+
253259
{
254-
break;
260+
let focus_on_diff = self.focus == Focus::Diff;
261+
out.push(CommandInfo::new(
262+
commands::STATUS_FOCUS_LEFT,
263+
true,
264+
(self.visible && focus_on_diff) || force_all,
265+
));
266+
out.push(CommandInfo::new(
267+
commands::STATUS_FOCUS_RIGHT,
268+
self.can_focus_diff(),
269+
(self.visible && !focus_on_diff) || force_all,
270+
));
255271
}
256-
}
257272

258-
{
259-
let focus_on_diff = self.focus == Focus::Diff;
260-
out.push(CommandInfo::new(
261-
commands::STATUS_FOCUS_LEFT,
262-
true,
263-
(self.visible && focus_on_diff) || force_all,
264-
));
265-
out.push(CommandInfo::new(
266-
commands::STATUS_FOCUS_RIGHT,
267-
self.can_focus_diff(),
268-
(self.visible && !focus_on_diff) || force_all,
269-
));
273+
out.push(
274+
CommandInfo::new(
275+
commands::SELECT_STATUS,
276+
true,
277+
(self.visible && self.focus == Focus::Diff)
278+
|| force_all,
279+
)
280+
.hidden(),
281+
);
282+
283+
out.push(
284+
CommandInfo::new(
285+
commands::SELECT_STAGING,
286+
true,
287+
(self.visible && self.focus == Focus::WorkDir)
288+
|| force_all,
289+
)
290+
.order(-2),
291+
);
292+
293+
out.push(
294+
CommandInfo::new(
295+
commands::SELECT_UNSTAGED,
296+
true,
297+
(self.visible && self.focus == Focus::Stage)
298+
|| force_all,
299+
)
300+
.order(-2),
301+
);
270302
}
271303

272-
out.push(
273-
CommandInfo::new(
274-
commands::SELECT_STATUS,
275-
true,
276-
(self.visible && self.focus == Focus::Diff)
277-
|| force_all,
278-
)
279-
.hidden(),
280-
);
281-
282-
out.push(
283-
CommandInfo::new(
284-
commands::SELECT_STAGING,
285-
true,
286-
(self.visible && self.focus == Focus::WorkDir)
287-
|| force_all,
288-
)
289-
.order(-2),
290-
);
291-
292-
out.push(
293-
CommandInfo::new(
294-
commands::SELECT_UNSTAGED,
295-
true,
296-
(self.visible && self.focus == Focus::Stage)
297-
|| force_all,
298-
)
299-
.order(-2),
300-
);
301-
302304
if self.visible {
303305
CommandBlocking::Blocking
304306
} else {

0 commit comments

Comments
 (0)