diff options
Diffstat (limited to 'src/preview/preview_default.rs')
-rw-r--r-- | src/preview/preview_default.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/preview/preview_default.rs b/src/preview/preview_default.rs index 002f5c0..7004449 100644 --- a/src/preview/preview_default.rs +++ b/src/preview/preview_default.rs @@ -3,10 +3,16 @@ use std::path; use crate::context::AppContext; use crate::fs::JoshutoMetadata; use crate::preview::{preview_dir, preview_file}; +use crate::ui::AppBackend; use super::preview_file::PreviewFileState; -pub fn load_preview_path(context: &mut AppContext, p: path::PathBuf, metadata: JoshutoMetadata) { +pub fn load_preview_path( + context: &mut AppContext, + backend: &mut AppBackend, + p: path::PathBuf, + metadata: JoshutoMetadata, +) { let preview_options = context.config_ref().preview_options_ref(); if metadata.is_dir() { let tab = context.tab_context_ref().curr_tab_ref(); @@ -38,13 +44,13 @@ pub fn load_preview_path(context: &mut AppContext, p: path::PathBuf, metadata: J .unwrap_or(true); if need_to_load { - preview_file::Background::preview_path_with_script(context, p); + preview_file::Background::preview_path_with_script(context, backend, p); } } else { } } -pub fn load_preview(context: &mut AppContext) { +pub fn load_preview(context: &mut AppContext, backend: &mut AppBackend) { let mut load_list = Vec::with_capacity(2); let curr_tab = context.tab_context_ref().curr_tab_ref(); @@ -63,6 +69,6 @@ pub fn load_preview(context: &mut AppContext) { } for (path, metadata) in load_list { - load_preview_path(context, path, metadata); + load_preview_path(context, backend, path, metadata); } } |