From 2032182cf9fd6c8eeed32251e8313123820d8eea Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Tue, 2 Jun 2020 14:28:32 +0200 Subject: [PATCH] arrow keys on end of file list switches focus (closes #105) --- CHANGELOG.md | 1 + src/tabs/status.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a626913e..31fa5109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/tabs/status.rs b/src/tabs/status.rs index 949753f6..fcd16a0f 100644 --- a/src/tabs/status.rs +++ b/src/tabs/status.rs @@ -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), }; }