summaryrefslogtreecommitdiffstats
path: root/src/commands/rename_file.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2019-04-25 07:49:55 -0400
committerJiayi Zhao <jeff.no.zhao@gmail.com>2019-04-25 07:49:55 -0400
commite0c3777930f87691eb8ade05c81764f9b2ae15b4 (patch)
tree64d762edd61e225e1c1f11a403fc961eedcde631 /src/commands/rename_file.rs
parent2be79f4cd0ee0e89c5cadf5121a8b979391d0d51 (diff)
refactor previewing
- remove dependency on preview.rs in commands/ - now can just call tab.refresh_preview to update the preview
Diffstat (limited to 'src/commands/rename_file.rs')
-rw-r--r--src/commands/rename_file.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/commands/rename_file.rs b/src/commands/rename_file.rs
index 6fbc7c8..47fd04b 100644
--- a/src/commands/rename_file.rs
+++ b/src/commands/rename_file.rs
@@ -1,10 +1,8 @@
-use std::fs;
use std::path;
use crate::commands::{JoshutoCommand, JoshutoRunnable};
use crate::context::JoshutoContext;
use crate::error::JoshutoError;
-use crate::preview;
use crate::textfield::JoshutoTextField;
use crate::ui;
use crate::window::JoshutoView;
@@ -76,6 +74,7 @@ impl RenameFile {
.curr_list
.update_contents(&context.config_t.sort_option)?;
curr_tab.refresh_curr(&view.mid_win, context.config_t.scroll_offset);
+ curr_tab.refresh_preview(&view.right_win, &context.config_t);
} else {
let curr_tab = &context.tabs[context.curr_tab_index];
curr_tab.refresh_file_status(&view.bot_win);
@@ -113,8 +112,6 @@ impl JoshutoRunnable for RenameFile {
Ok(_) => {},
Err(e) => return Err(JoshutoError::IO(e)),
}
- let curr_tab = &mut context.tabs[context.curr_tab_index];
- preview::preview_file(curr_tab, view, &context.config_t);
ncurses::doupdate();
}
}