@lvce-editor/editor-worker 19.26.2 → 19.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +18 -1
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -13338,6 +13338,15 @@ const updateDiagnostics = async editor => {
|
|
|
13338
13338
|
}
|
|
13339
13339
|
};
|
|
13340
13340
|
|
|
13341
|
+
const editorDiagnosticEffect = {
|
|
13342
|
+
// TODO set effects delay / diagnostic delay
|
|
13343
|
+
apply(editor) {
|
|
13344
|
+
return updateDiagnostics(editor);
|
|
13345
|
+
},
|
|
13346
|
+
// TODO avoid slow comparison
|
|
13347
|
+
isActive: (oldEditor, newEditor) => newEditor.diagnosticsEnabled && JSON.stringify(oldEditor.lines) !== JSON.stringify(newEditor.lines)
|
|
13348
|
+
};
|
|
13349
|
+
|
|
13341
13350
|
const queues = [];
|
|
13342
13351
|
|
|
13343
13352
|
// TODO wrap commands globally, not per editor
|
|
@@ -13362,7 +13371,15 @@ const wrapCommand = fn => async (uid, ...args) => {
|
|
|
13362
13371
|
}
|
|
13363
13372
|
const newEditorWithDerivedState = await updateDerivedState(state, newEditor);
|
|
13364
13373
|
set$9(uid, state, newEditorWithDerivedState);
|
|
13365
|
-
|
|
13374
|
+
if (!editorDiagnosticEffect.isActive(state, newEditorWithDerivedState)) {
|
|
13375
|
+
return newEditorWithDerivedState;
|
|
13376
|
+
}
|
|
13377
|
+
const newEditorWithDiagnostics = await editorDiagnosticEffect.apply(newEditorWithDerivedState);
|
|
13378
|
+
if (!get$7(uid)) {
|
|
13379
|
+
return newEditorWithDiagnostics;
|
|
13380
|
+
}
|
|
13381
|
+
set$9(uid, state, newEditorWithDiagnostics);
|
|
13382
|
+
return newEditorWithDiagnostics;
|
|
13366
13383
|
} finally {
|
|
13367
13384
|
resolve();
|
|
13368
13385
|
if (queues[uid] === next) {
|