right arrow in file tree convenience

This commit is contained in:
Stephan Dilly 2020-06-10 09:35:27 +02:00
parent 599aa10b52
commit 0ec7552569
2 changed files with 17 additions and 5 deletions

View File

@ -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)

View File

@ -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)