summaryrefslogtreecommitdiffstats
path: root/src/commands/delete_files.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-05-29 23:06:38 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-05-29 23:07:27 -0400
commit5980d762dba38b003dbe54506cdd58ee85f97c8c (patch)
tree28e07e112586b73e1de426f7ae34c8c2afc68fdb /src/commands/delete_files.rs
parent5d8525a9cc8a61e8e66a92f66132ad11ce112ff7 (diff)
move hostname and username out of Context and into a static global
Diffstat (limited to 'src/commands/delete_files.rs')
-rw-r--r--src/commands/delete_files.rs36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/commands/delete_files.rs b/src/commands/delete_files.rs
index 615f12d..a742499 100644
--- a/src/commands/delete_files.rs
+++ b/src/commands/delete_files.rs
@@ -56,31 +56,23 @@ impl DeleteFiles {
ui::wprint_msg(&view.bot_win, "Deleted files");
curr_tab.reload_contents(&context.config_t.sort_option)?;
- curr_tab.refresh(
- &view,
- &context.config_t,
- &context.username,
- &context.hostname,
- );
+
+ if let Some(s) = curr_tab.curr_list.index {
+ curr_tab.curr_list.pagestate.update_page_state(
+ s,
+ view.mid_win.rows,
+ curr_tab.curr_list.contents.len(),
+ context.config_t.scroll_offset,
+ );
+ }
+ curr_tab.refresh_curr(&view.mid_win);
+ curr_tab.refresh_parent(&view.left_win, &context.config_t);
+ curr_tab.refresh_preview(&view.right_win, &context.config_t);
}
- } else {
- curr_tab.refresh_file_status(&view.bot_win);
- curr_tab.refresh_path_status(
- &view.top_win,
- &context.username,
- &context.hostname,
- context.config_t.tilde_in_titlebar,
- );
}
- } else {
- curr_tab.refresh_file_status(&view.bot_win);
- curr_tab.refresh_path_status(
- &view.top_win,
- &context.username,
- &context.hostname,
- context.config_t.tilde_in_titlebar,
- );
}
+ curr_tab.refresh_file_status(&view.bot_win);
+ curr_tab.refresh_path_status(&view.top_win, context.config_t.tilde_in_titlebar);
ncurses::doupdate();
Ok(())
}