arrow keys on end of file list switches focus (closes #105)

This commit is contained in:
Stephan Dilly 2020-06-02 14:28:32 +02:00
parent aa79b92f59
commit 2032182cf9
2 changed files with 10 additions and 0 deletions

View File

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- changed hotkeys for selecting stage/workdir (**[w] / [s]** now to change between workdir and stage) and added hotkeys (`[1234]`) to switch to tabs directly ([#92](https://github.com/extrawurst/gitui/issues/92))
- `arrow-up`/`down` on bottom/top of status file list switches focus ([#105](https://github.com/extrawurst/gitui/issues/105))
## [0.5.0] - 2020-06-01

View File

@ -365,6 +365,15 @@ impl Component for Status {
DiffTarget::WorkingDir => Focus::WorkDir,
})
}
keys::MOVE_DOWN
if self.focus == Focus::WorkDir =>
{
self.switch_focus(Focus::Stage)
}
keys::MOVE_UP if self.focus == Focus::Stage => {
self.switch_focus(Focus::WorkDir)
}
_ => Ok(false),
};
}