summaryrefslogtreecommitdiffstats
path: root/src/commands/new_directory.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-20 11:55:27 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-03-20 11:55:27 -0400
commit84e912b7779faaaeb09d1085e09630a548c7fb54 (patch)
tree662665d1b7f1401ac9259bd6fa12e5e6aa2890ec /src/commands/new_directory.rs
parentbd779fc6df4641f81bbbfe50663d883d64a5c88e (diff)
Add more reloading triggers
Diffstat (limited to 'src/commands/new_directory.rs')
-rw-r--r--src/commands/new_directory.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/commands/new_directory.rs b/src/commands/new_directory.rs
index ab7c170..ce27bc9 100644
--- a/src/commands/new_directory.rs
+++ b/src/commands/new_directory.rs
@@ -3,7 +3,9 @@ use std::path;
use crate::commands::{JoshutoCommand, JoshutoRunnable, ReloadDirList};
use crate::context::JoshutoContext;
use crate::error::JoshutoResult;
+use crate::history::DirectoryHistory;
use crate::ui::TuiBackend;
+use crate::util::load_child::LoadChild;
#[derive(Clone, Debug)]
pub struct NewDirectory {
@@ -32,7 +34,14 @@ impl JoshutoRunnable for NewDirectory {
for path in &self.paths {
std::fs::create_dir_all(path)?;
}
- ReloadDirList::reload(context.curr_tab_index, context)?;
+
+ let options = &context.config_t.sort_option;
+ let curr_path = context.tabs[context.curr_tab_index].curr_path.clone();
+ for tab in context.tabs.iter_mut() {
+ tab.history.reload(&curr_path, options);
+ }
+
+ LoadChild::load_child(context)?;
Ok(())
}
}