Refresh interactive TeX state across successive edits
This commit is contained in:
1 parent
38e4822370
commit
28668ea10f
7 files changed
+559
-133
No files matched your search
@@ -10,7 +10,7 @@ use texrra_tex_core::{
|
||||
resources::{LoadedResource, ResourceKind},
|
||||
};
|
||||
|
||||
pub(super) type Call = Box<dyn Fn(&mut Files) -> Result<(), String> + Send + Sync>;
|
||||
pub(super) type Call = Arc<dyn Fn(&mut Files) -> Result<(), String> + Send + Sync>;
|
||||
const MAX_REPLAY_CALLS: usize = 65_536;
|
||||
|
||||
pub(super) struct RecordingHost<'a> {
|
||||
@@ -20,9 +20,13 @@ pub(super) struct RecordingHost<'a> {
|
||||
|
||||
impl<'a> RecordingHost<'a> {
|
||||
pub(super) fn new(files: &'a mut Files) -> Self {
|
||||
Self::after_replay(files, &[])
|
||||
}
|
||||
|
||||
pub(super) fn after_replay(files: &'a mut Files, prefix: &[Call]) -> Self {
|
||||
Self {
|
||||
files,
|
||||
calls: Some(Vec::new()),
|
||||
calls: Some(prefix.to_vec()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +58,7 @@ impl<'a> RecordingHost<'a> {
|
||||
return result;
|
||||
}
|
||||
let expected = evidence(&result);
|
||||
calls.push(Box::new(move |files| {
|
||||
calls.push(Arc::new(move |files| {
|
||||
let observed = evidence(&call(files));
|
||||
if observed == expected {
|
||||
Ok(())
|
||||
|
||||
Reference in new issue
Block a user