Skip to content

Commit ce45c88

Browse files
author
Stephan Dilly
committed
only switch when target is not-empty (#105)
1 parent 2032182 commit ce45c88

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tabs/status.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,16 @@ impl Component for Status {
366366
})
367367
}
368368
keys::MOVE_DOWN
369-
if self.focus == Focus::WorkDir =>
369+
if self.focus == Focus::WorkDir
370+
&& !self.index.is_empty() =>
370371
{
371372
self.switch_focus(Focus::Stage)
372373
}
373374

374-
keys::MOVE_UP if self.focus == Focus::Stage => {
375+
keys::MOVE_UP
376+
if self.focus == Focus::Stage
377+
&& !self.index_wd.is_empty() =>
378+
{
375379
self.switch_focus(Focus::WorkDir)
376380
}
377381
_ => Ok(false),

0 commit comments

Comments
 (0)