diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-08-30 15:20:03 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-08-30 15:20:03 -0400 |
commit | e7218c81d90ae07d7f56dce0c3032db15b11d118 (patch) | |
tree | 63c3b63345ec73031b26c1b900957ad06b69aec6 /src/fs | |
parent | a592bfe51c0cbb7744f14586520827cb06da8c8d (diff) |
rework and fix issues
- fixed bug where io tasks would not run when user is in a textfield or prompt
- fixed bug where cut doesn't work
- rework structs to have private fields and public functions
- move IOWorkerObserver into seperate file
- move code from TuiView to TuiFolderView
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/dirlist.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fs/dirlist.rs b/src/fs/dirlist.rs index 65e2db0..7569b29 100644 --- a/src/fs/dirlist.rs +++ b/src/fs/dirlist.rs @@ -100,13 +100,16 @@ impl JoshutoDirList { self.contents.iter().filter(|entry| entry.is_selected()) } - pub fn get_selected_paths(&self) -> Vec<&path::Path> { - let vec: Vec<&path::Path> = self.selected_entries().map(|e| e.file_path()).collect(); + pub fn get_selected_paths(&self) -> Vec<path::PathBuf> { + let vec: Vec<path::PathBuf> = self + .selected_entries() + .map(|e| e.file_path().to_path_buf()) + .collect(); if !vec.is_empty() { vec } else { match self.get_curr_ref() { - Some(s) => vec![s.file_path()], + Some(s) => vec![s.file_path().to_path_buf()], _ => vec![], } } |