From 0ec75525692c31cdef5411a1ff091ff9f81e550e Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Wed, 10 Jun 2020 09:35:27 +0200 Subject: [PATCH] right arrow in file tree convenience --- CHANGELOG.md | 3 +++ src/components/utils/statustree.rs | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d57f672..ff23319f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- file trees: `arrow-right` on expanded folder moves down into folder + ## [0.6.0] - 2020-06-09 ![](assets/commit-details.gif) diff --git a/src/components/utils/statustree.rs b/src/components/utils/statustree.rs index 6e5835ad..c2462d5a 100644 --- a/src/components/utils/statustree.rs +++ b/src/components/utils/statustree.rs @@ -199,11 +199,20 @@ impl StatusTree { let item_path = self.tree[current_selection].info.full_path.clone(); - if matches!(item_kind, FileTreeItemKind::Path(PathCollapsed(collapsed)) - if collapsed) - { - self.expand(&item_path, current_selection); - return SelectionChange::new(current_selection, true); + match item_kind { + FileTreeItemKind::Path(PathCollapsed(collapsed)) + if collapsed => + { + self.expand(&item_path, current_selection); + return SelectionChange::new(current_selection, true); + } + FileTreeItemKind::Path(PathCollapsed(collapsed)) + if !collapsed => + { + return self + .selection_updown(current_selection, false); + } + _ => (), } SelectionChange::new(current_selection, false)