summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-06 14:01:07 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-06 14:01:07 +0530
commit96121b55802e2ba038129cafafc48910e29a8a8f (patch)
tree8e7ca6d4617525c6b56a1558761248ee30322da5 /src
parent0718d2a2a1f8ac16f0bbd30b520a3804e09eab41 (diff)
Fix issue with seeing nothing when trying to enter a file
...there was (and still is) no test for that.
Diffstat (limited to 'src')
-rw-r--r--src/interactive/app/handlers.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interactive/app/handlers.rs b/src/interactive/app/handlers.rs
index 6bbdc46..1240b3f 100644
--- a/src/interactive/app/handlers.rs
+++ b/src/interactive/app/handlers.rs
@@ -70,11 +70,12 @@ impl TerminalApp {
pub fn enter_node(&mut self) {
if let Some(new_root) = self.state.selected {
- self.state.entries = sorted_entries(&self.traversal.tree, new_root, self.state.sorting);
- match self.state.entries.get(0) {
+ let new_entries = sorted_entries(&self.traversal.tree, new_root, self.state.sorting);
+ match new_entries.get(0) {
Some(b) => {
self.state.root = new_root;
self.state.selected = Some(b.index);
+ self.state.entries = new_entries;
}
None => self.state.message = Some("Entry is a file or an empty directory".into()),
}