diff options
Diffstat (limited to 'src/run.rs')
-rw-r--r-- | src/run.rs | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -4,6 +4,9 @@ use crate::context::calculate_external_preview; use crate::context::AppContext; use crate::event::process_event; use crate::event::AppEvent; +use crate::history::generate_entries_to_root; +use crate::history::DirectoryHistory; +use crate::history::JoshutoHistory; use crate::key_command::{AppExecute, CommandKeybind}; use crate::preview::preview_default; use crate::tab::JoshutoTab; @@ -33,12 +36,23 @@ pub fn run_loop( { let id = Uuid::new_v4(); // Initialize an initial tab - let tab = JoshutoTab::new( - curr_path, + let mut new_tab_history = JoshutoHistory::new(); + let tab_display_options = context + .config_ref() + .display_options_ref() + .default_tab_display_option + .clone(); + let dirlists = generate_entries_to_root( + curr_path.as_path(), context.config_ref(), + &new_tab_history, context.ui_context_ref(), context.config_ref().display_options_ref(), + &tab_display_options, )?; + new_tab_history.insert_entries(dirlists); + + let tab = JoshutoTab::new(curr_path, new_tab_history, tab_display_options)?; context.tab_context_mut().insert_tab(id, tab); // trigger a preview of child |