diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-08-29 22:06:19 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-08-29 22:08:23 -0400 |
commit | 5be4a5f472655a76e1430bad09a19f6ad111e474 (patch) | |
tree | 1fcffa6c8d37cc6d538b29b6fbd773e8de58512d /src/commands/change_directory.rs | |
parent | 4f3842b56f1729dcd8e81c77f98253ed9dfb23b3 (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/change_directory.rs')
-rw-r--r-- | src/commands/change_directory.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/commands/change_directory.rs b/src/commands/change_directory.rs index ac97d59..022d306 100644 --- a/src/commands/change_directory.rs +++ b/src/commands/change_directory.rs @@ -22,10 +22,7 @@ impl ChangeDirectory { pub fn cd(path: &path::Path, context: &mut JoshutoContext) -> std::io::Result<()> { std::env::set_current_dir(path)?; - - let curr_tab = &mut context.tabs[context.curr_tab_index]; - curr_tab.curr_path = path.to_path_buf(); - + context.tab_context_mut().curr_tab_mut().set_pwd(path); Ok(()) } @@ -35,10 +32,12 @@ impl ChangeDirectory { ) -> std::io::Result<()> { Self::cd(path, context)?; - let curr_tab = &mut context.tabs[context.curr_tab_index]; - curr_tab + let sort_options = context.config_t.sort_option.clone(); + context + .tab_context_mut() + .curr_tab_mut() .history - .populate_to_root(&path, &context.config_t.sort_option)?; + .populate_to_root(&path, &sort_options)?; Ok(()) } |