diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-27 21:11:19 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-27 21:14:27 -0400 |
commit | 4e00e82c62ded6e531f173914a68984307974323 (patch) | |
tree | 51c73862e8076736adf90f901240d11f7a2e62d5 /src/tab.rs | |
parent | 35579905606926893d4e7c0f3f58096c5b581444 (diff) |
move updating page state to cursor_move only
- refactor page state to take an end to prevent
blank views on init
- move functions out of JoshutoPanel into ui.rs
- create a struct for configuring how to display content
- new type JoshutoHistory
- rename display_options to display_menu
Diffstat (limited to 'src/tab.rs')
-rw-r--r-- | src/tab.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -2,7 +2,7 @@ use std::collections::{hash_map::Entry, HashMap}; use std::path::PathBuf; use crate::config; -use crate::history::DirectoryHistory; +use crate::history::{DirectoryHistory, JoshutoHistory}; use crate::preview; use crate::sort; use crate::structs::JoshutoDirList; @@ -12,7 +12,7 @@ use crate::window::{JoshutoPanel, JoshutoView}; use crate::THEME_T; pub struct JoshutoTab { - pub history: HashMap<PathBuf, JoshutoDirList>, + pub history: JoshutoHistory, pub curr_path: PathBuf, pub curr_list: JoshutoDirList, } @@ -80,7 +80,7 @@ impl JoshutoTab { username: &str, hostname: &str, ) { - self.refresh_curr(&views.mid_win, config_t.scroll_offset); + self.refresh_curr(&views.mid_win); self.refresh_parent(&views.left_win, config_t); self.refresh_preview(&views.right_win, config_t); self.refresh_path_status( @@ -92,8 +92,8 @@ impl JoshutoTab { self.refresh_file_status(&views.bot_win); } - pub fn refresh_curr(&mut self, win: &JoshutoPanel, scroll_offset: usize) { - win.display_contents_detailed(&mut self.curr_list, scroll_offset); + pub fn refresh_curr(&self, win: &JoshutoPanel) { + ui::display_contents(win, &self.curr_list, &ui::PRIMARY_DISPLAY_OPTION); win.queue_for_refresh(); } |