summaryrefslogtreecommitdiffstats
path: root/src/commands/open_file.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/open_file.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/open_file.rs')
-rw-r--r--src/commands/open_file.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/commands/open_file.rs b/src/commands/open_file.rs
index e698913..c5c1c90 100644
--- a/src/commands/open_file.rs
+++ b/src/commands/open_file.rs
@@ -53,7 +53,10 @@ impl OpenFile {
if curr_tab.curr_list.need_update() {
curr_tab
.curr_list
- .update_contents(&context.config_t.sort_option)?;
+ .reload_contents(&context.config_t.sort_option)?;
+ curr_tab
+ .curr_list
+ .sort(context.config_t.sort_option.compare_func());
}
curr_tab.refresh(view, &context.config_t);
} else {
@@ -69,7 +72,10 @@ impl OpenFile {
if curr_tab.curr_list.need_update() {
curr_tab
.curr_list
- .update_contents(&context.config_t.sort_option)?;
+ .reload_contents(&context.config_t.sort_option)?;
+ curr_tab
+ .curr_list
+ .sort(context.config_t.sort_option.compare_func());
}
curr_tab.refresh(view, &context.config_t);
}
@@ -102,7 +108,7 @@ impl OpenFile {
if mimetype_options.is_empty() {
open::that(&paths[0]).unwrap();
} else {
- unix::open_with_entry(paths, &mimetype_options[0]);
+ mimetype_options[0].execute_with(paths);
}
ncurses::resetty();
ncurses::refresh();
@@ -177,7 +183,7 @@ impl OpenFileWith {
if s < mimetype_options.len() {
ncurses::savetty();
ncurses::endwin();
- unix::open_with_entry(paths, &mimetype_options[s]);
+ mimetype_options[s].execute_with(paths);
ncurses::resetty();
ncurses::refresh();
}