diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-10-24 19:29:38 +0200 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-10-24 19:29:38 +0200 |
commit | ad86a843f89ca5d8fb37f802625261b740e1a145 (patch) | |
tree | 9ff896c53d66eea735f37a1575267ef4e47e180e /src/tab.rs | |
parent | cd4e066f23cfe8f514a7038c8cebd35ef5764873 (diff) |
Tree mode: file & directory are created in selected dir
Diffstat (limited to 'src/tab.rs')
-rw-r--r-- | src/tab.rs | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -413,16 +413,7 @@ impl Tab { /// In normal mode it's the current working directory. pub fn directory_of_selected(&self) -> Result<&path::Path> { match self.mode { - Mode::Tree => { - let fileinfo = &self.directory.tree.current_node.fileinfo; - match fileinfo.file_kind { - FileKind::Directory => Ok(&self.directory.tree.current_node.fileinfo.path), - _ => Ok(fileinfo - .path - .parent() - .context("selected file should have a parent")?), - } - } + Mode::Tree => self.directory.tree.directory_of_selected(), _ => Ok(&self.path_content.path), } } |