summaryrefslogtreecommitdiffstats
path: root/src/tab.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-02-17 21:36:45 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-02-17 21:36:45 -0500
commite7bcdd1fc7685e1f132adc267e56cdae2925d632 (patch)
tree2f1a5352d67a788dfc90a9c966bd20379aa9d293 /src/tab.rs
parent686033bfcf6d34bfb180e0b0f64ae4493340bf38 (diff)
reload_dir now reloads parent and child as well
Diffstat (limited to 'src/tab.rs')
-rw-r--r--src/tab.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tab.rs b/src/tab.rs
index 08bf0ee..0bf9138 100644
--- a/src/tab.rs
+++ b/src/tab.rs
@@ -45,4 +45,14 @@ impl JoshutoTab {
let parent = self.curr_path.parent()?;
self.history.get_mut(parent)
}
+
+ pub fn child_list_mut(&mut self) -> Option<&mut JoshutoDirList> {
+ let path = {
+ let curr_list = self.curr_list_ref()?;
+ let index = curr_list.index?;
+ curr_list.contents[index].file_path().clone()
+ };
+
+ self.history.get_mut(path.as_path())
+ }
}