summaryrefslogtreecommitdiffstats
path: root/src/commands/new_directory.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-08-29 22:06:19 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-08-29 22:08:23 -0400
commit5be4a5f472655a76e1430bad09a19f6ad111e474 (patch)
tree1fcffa6c8d37cc6d538b29b6fbd773e8de58512d /src/commands/new_directory.rs
parent4f3842b56f1729dcd8e81c77f98253ed9dfb23b3 (diff)
big rework and dependency update
- abstract JoshutoContext implementation behind functions - rework io workers in an attempt to fix a bug - update dependencies - remove JoshutoContextWorker
Diffstat (limited to 'src/commands/new_directory.rs')
-rw-r--r--src/commands/new_directory.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands/new_directory.rs b/src/commands/new_directory.rs
index f1ce5e4..401e2a2 100644
--- a/src/commands/new_directory.rs
+++ b/src/commands/new_directory.rs
@@ -33,10 +33,10 @@ impl JoshutoRunnable for NewDirectory {
fn execute(&self, context: &mut JoshutoContext, _: &mut TuiBackend) -> JoshutoResult<()> {
std::fs::create_dir_all(&self.path)?;
- 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)?;
+ let options = context.config_t.sort_option.clone();
+ let curr_path = context.tab_context_ref().curr_tab_ref().pwd().to_path_buf();
+ for tab in context.tab_context_mut().iter_mut() {
+ tab.history.reload(&curr_path, &options)?;
}
LoadChild::load_child(context)?;