Stop obsolete draft rendering between pages
This commit is contained in:
1 parent
eda01fb689
commit
b5e87a8706
5 files changed
+33
-3
No files matched your search
+13
-2
@@ -97,11 +97,18 @@ pub trait CompileObserver: Send + Sync {
|
||||
/// The same revision's native preview, available before artifact publication.
|
||||
pub struct DraftPreview<'a> {
|
||||
document: &'a CompiledDocument,
|
||||
cancellation: &'a Cancellation,
|
||||
}
|
||||
|
||||
impl DraftPreview<'_> {
|
||||
pub fn preview_since(&self, visible_revision: Option<u64>) -> Result<PreviewUpdate, String> {
|
||||
self.document.preview_since(visible_revision)
|
||||
self.document.preview.render(
|
||||
self.document.revision(),
|
||||
&self.document.pages,
|
||||
self.document.pdf.as_ref(),
|
||||
visible_revision,
|
||||
|| check(self.cancellation).map_err(|error| error.to_string()),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn execution_steps(&self) -> usize {
|
||||
@@ -245,6 +252,7 @@ impl CompiledDocument {
|
||||
&self.pages,
|
||||
self.pdf.as_ref(),
|
||||
visible_revision,
|
||||
|| Ok(()),
|
||||
)
|
||||
}
|
||||
pub fn has_show_diagnostic(&self) -> bool {
|
||||
@@ -1184,7 +1192,10 @@ impl CompileJob {
|
||||
if checkpoints.is_some()
|
||||
&& let Some(observer) = &request.observer
|
||||
{
|
||||
let observed = observer.draft_ready(DraftPreview { document: &result });
|
||||
let observed = observer.draft_ready(DraftPreview {
|
||||
document: &result,
|
||||
cancellation: &cancellation,
|
||||
});
|
||||
check(&cancellation)?;
|
||||
observed?;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user