summaryrefslogtreecommitdiffstats
path: root/src/run.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/run.rs b/src/run.rs
index f984391..1147d52 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -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