diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-11-05 02:09:54 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-11-05 02:09:54 +0100 |
commit | bd1cb2b3f325ddaa019972762aa32fd4db286eaf (patch) | |
tree | 93bc7c0761d88e783974fa5c8dd5c1e3d520befe /src/tab.rs | |
parent | efe46e9abb71c6cfc6a4c56a15920ec73183f0a0 (diff) |
doesn't work yet, is way quicker
Diffstat (limited to 'src/tab.rs')
-rw-r--r-- | src/tab.rs | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -16,6 +16,7 @@ use crate::opener::execute_in_child; use crate::preview::{Directory, Preview}; use crate::selectable_content::SelectableContent; use crate::shortcut::Shortcut; +use crate::trees::FileSystem; use crate::users::Users; use crate::utils::{filename_from_path, row_to_window_index, set_clipboard}; @@ -56,6 +57,7 @@ pub struct Tab { pub history: History, /// Users & groups pub users: Users, + pub tree: FileSystem, } impl Tab { @@ -89,6 +91,7 @@ impl Tab { shortcut.extend_with_mount_points(mount_points); let searched = None; let index = path_content.select_file(&path); + let tree = FileSystem::empty(); window.scroll_to(index); Ok(Self { mode, @@ -107,6 +110,7 @@ impl Tab { show_hidden, history, users, + tree, }) } @@ -427,7 +431,15 @@ impl Tab { pub fn make_tree(&mut self) -> Result<()> { let path = self.path_content.path.clone(); let users = &self.users; - self.directory = Directory::new(&path, users, &self.filter, self.show_hidden, None)?; + // self.directory = Directory::new(&path, users, &self.filter, self.show_hidden, None)?; + self.tree = FileSystem::new( + path, + 5, + self.path_content.sort_kind.clone(), + users, + self.show_hidden, + &self.filter, + ); Ok(()) } @@ -530,11 +542,13 @@ impl Tab { /// Select the next sibling of the current node. pub fn select_next(&mut self) -> Result<()> { + self.tree.next(); self.tree_select_next() } /// Select the previous sibling of the current node. pub fn select_prev(&mut self) -> Result<()> { + self.tree.prev(); self.tree_select_prev() } |