diff options
-rw-r--r-- | src/event_exec.rs | 10 | ||||
-rw-r--r-- | src/trees.rs | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/event_exec.rs b/src/event_exec.rs index d3e3a3d..6117a63 100644 --- a/src/event_exec.rs +++ b/src/event_exec.rs @@ -896,10 +896,6 @@ impl EventAction { /// Has no effect on "file" nodes. pub fn tree_fold(tab: &mut Tab) -> Result<()> { tab.tree.toggle_fold(); - // let (tree, _, _) = tab.directory.tree.explore_position(false); - // tree.node.toggle_fold(); - // tab.directory.make_preview(); - // tab.tree_select_next() Ok(()) } @@ -907,9 +903,7 @@ impl EventAction { /// Recursively explore the tree and unfold every node. /// Reset the display. pub fn tree_unfold_all(tab: &mut Tab) -> Result<()> { - tab.tree.fold_all(); - // tab.directory.tree.unfold_children(); - // tab.directory.make_preview(); + tab.tree.unfold_all(); Ok(()) } @@ -918,8 +912,6 @@ impl EventAction { /// Reset the display. pub fn tree_fold_all(tab: &mut Tab) -> Result<()> { tab.tree.fold_all(); - // tab.directory.tree.fold_children(); - // tab.directory.make_preview(); Ok(()) } diff --git a/src/trees.rs b/src/trees.rs index c735873..ad94120 100644 --- a/src/trees.rs +++ b/src/trees.rs @@ -281,6 +281,12 @@ impl FileSystem { } } + pub fn unfold_all(&mut self) { + for (_, node) in self.nodes.iter_mut() { + node.unfold() + } + } + // FIX: can only find the first match and nothing else pub fn search_first_match(&mut self, pattern: &str) { let initial_selected = self.selected.to_owned(); |