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)