summaryrefslogtreecommitdiffstats
path: root/src/run.rs
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2024-03-10 21:17:09 -0400
committerJeff Zhao <jeff.no.zhao@gmail.com>2024-03-10 21:17:09 -0400
commit8af827604620f8135c98d6f4c8e4b647c06d1c32 (patch)
tree8641bdd607177d92df3c91e700493c65f120859d /src/run.rs
parent4267cb55085b24770ee35c841c940f8ea7233445 (diff)
move preview area into PreviewContext
- move a bunch of methods out into functions
Diffstat (limited to 'src/run.rs')
-rw-r--r--src/run.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/run.rs b/src/run.rs
index 958fe80..884564c 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -1,5 +1,6 @@
use crate::commands::quit::QuitAction;
use crate::config::clean::keymap::AppKeyMapping;
+use crate::context::calculate_external_preview;
use crate::context::AppContext;
use crate::event::process_event;
use crate::event::AppEvent;
@@ -53,7 +54,17 @@ pub fn run_loop(
backend.render(TuiView::new(context));
// invoke preview hooks, if appropriate
- context.update_external_preview();
+ {
+ let new_preview_area = calculate_external_preview(
+ context.tab_context_ref(),
+ context.preview_context_ref(),
+ context.ui_context_ref(),
+ context.config_ref().preview_options_ref(),
+ );
+ context
+ .preview_context_mut()
+ .update_external_preview(new_preview_area);
+ }
}
// wait for an event and pop it