Flush queued IDE writes and restart validation after host revision changes
This commit is contained in:
@@ -554,6 +554,11 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
|
||||
|
||||
private void load(DocumentSnapshot value) {
|
||||
if (closed) return;
|
||||
// A newer host revision can have identical text (edit/revert or native reload).
|
||||
// Its predecessor's validation reply will be rejected by revision, so it must
|
||||
// not leave an in-flight marker that absorbs every subsequent render request.
|
||||
if (draft == null || draft.revision() != value.revision() || !draft.text().equals(value.text()))
|
||||
invalidateBindings("Document synchronized; target validation outdated.");
|
||||
loading = true;
|
||||
layoutPasses = 0;
|
||||
canvasCommitQueued = false;
|
||||
@@ -635,6 +640,9 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
|
||||
report(error);
|
||||
} finally {
|
||||
loading = false;
|
||||
// The change debounce may already have fired against the previous draft.
|
||||
// Render only after the authoritative revision and its projection agree.
|
||||
if (projection != null && examples.getValue() != null) resize.playFromStart();
|
||||
if (pendingSourceOffset != null) {
|
||||
int offset = pendingSourceOffset;
|
||||
pendingSourceOffset = null;
|
||||
|
||||
Reference in New Issue
Block a user