Skip to content

Commit

Permalink
only switch when target is not-empty (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed Jun 2, 2020
1 parent 2032182 commit ce45c88
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tabs/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,16 @@ impl Component for Status {
})
}
keys::MOVE_DOWN
if self.focus == Focus::WorkDir =>
if self.focus == Focus::WorkDir
&& !self.index.is_empty() =>
{
self.switch_focus(Focus::Stage)
}

keys::MOVE_UP if self.focus == Focus::Stage => {
keys::MOVE_UP
if self.focus == Focus::Stage
&& !self.index_wd.is_empty() =>
{
self.switch_focus(Focus::WorkDir)
}
_ => Ok(false),
Expand Down

0 comments on commit ce45c88

Please sign in to comment.