summaryrefslogtreecommitdiffstats
path: root/src/commands/reload_dir.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-07-19 21:33:08 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-07-19 22:18:23 -0400
commit0b8747eb37d6d943d90e15ed82858d99d1800425 (patch)
tree6cb910dc37343000296c2951e0f67ff269ee3efd /src/commands/reload_dir.rs
parent98e9665e59d7af0b2c002f0e6007578b3e90aa69 (diff)
changed how commands are handled
- arguments no longer go through wordexp (still working on a good alternative) other changes: - changed update_contents to reload_contents - opening files with mimetype entries are now moved from unix.rs to mimetypes.rs
Diffstat (limited to 'src/commands/reload_dir.rs')
-rw-r--r--src/commands/reload_dir.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/reload_dir.rs b/src/commands/reload_dir.rs
index f126f02..4524e04 100644
--- a/src/commands/reload_dir.rs
+++ b/src/commands/reload_dir.rs
@@ -20,16 +20,17 @@ impl ReloadDirList {
pub fn reload(index: usize, context: &mut JoshutoContext) -> std::io::Result<()> {
let curr_tab = &mut context.tabs[index];
let sort_option = &context.config_t.sort_option;
- curr_tab.curr_list.update_contents(sort_option)?;
+ curr_tab.curr_list.reload_contents(sort_option)?;
if let Some(parent) = curr_tab.curr_list.file_path().parent() {
match curr_tab.history.entry(parent.to_path_buf().clone()) {
Entry::Occupied(mut entry) => {
let dirlist = entry.get_mut();
- dirlist.update_contents(sort_option)?;
+ dirlist.reload_contents(sort_option)?;
}
Entry::Vacant(entry) => {
- let s = JoshutoDirList::new(parent.to_path_buf().clone(), sort_option)?;
+ let mut s = JoshutoDirList::new(parent.to_path_buf().clone(), &sort_option)?;
+ s.sort(sort_option.compare_func());
entry.insert(s);
}
}