diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-06-04 10:49:47 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-06-04 13:26:09 -0400 |
commit | 7036a7e6ff57b7e5e4b99133ea7466a3b24bf0ce (patch) | |
tree | a23141ae6474748f7ae49e04316136f2906fe7bd /src/tab.rs | |
parent | da20212f32c8b43400d0aec2af39376651f32b9d (diff) |
revert back to previous printing method
- fix index out of bounds error when multiple threads are running
Diffstat (limited to 'src/tab.rs')
-rw-r--r-- | src/tab.rs | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -1,6 +1,6 @@ use std::path::PathBuf; -use crate::config; +use crate::JoshutoConfig; use crate::history::{DirectoryHistory, JoshutoHistory}; use crate::preview; use crate::sort; @@ -33,27 +33,26 @@ impl JoshutoTab { Ok(tab) } - pub fn refresh(&mut self, views: &JoshutoView, config_t: &config::JoshutoConfig) { - self.refresh_curr(&views.mid_win); + pub fn refresh(&mut self, views: &JoshutoView, config_t: &JoshutoConfig) { + self.refresh_curr(&views.mid_win, config_t); self.refresh_parent(&views.left_win, config_t); - self.refresh_preview(&views.right_win, config_t); + if config_t.show_preview { + self.refresh_preview(&views.right_win, config_t); + } self.refresh_path_status(&views.top_win, config_t.tilde_in_titlebar); self.refresh_file_status(&views.bot_win); } - pub fn refresh_curr(&self, win: &JoshutoPanel) { - ui::display_contents(win, &self.curr_list, &ui::PRIMARY_DISPLAY_OPTION); - win.queue_for_refresh(); + pub fn refresh_curr(&mut self, win: &JoshutoPanel, config_t: &JoshutoConfig) { + ui::display_contents(win, &mut self.curr_list, config_t, &ui::PRIMARY_DISPLAY_OPTION); } - pub fn refresh_parent(&mut self, win: &JoshutoPanel, config_t: &config::JoshutoConfig) { + pub fn refresh_parent(&mut self, win: &JoshutoPanel, config_t: &JoshutoConfig) { preview::preview_parent(self, win, config_t); } - pub fn refresh_preview(&mut self, win: &JoshutoPanel, config_t: &config::JoshutoConfig) { - if config_t.show_preview { - preview::preview_entry(self, win, config_t); - } + pub fn refresh_preview(&mut self, win: &JoshutoPanel, config_t: &JoshutoConfig) { + preview::preview_entry(self, win, config_t); } pub fn refresh_file_status(&self, win: &JoshutoPanel) { |