@lvce-editor/editor-worker 19.71.2 → 19.71.4
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 +26 -6
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -12402,6 +12402,24 @@ const openRename = async editor => {
|
|
|
12402
12402
|
if (!word) {
|
|
12403
12403
|
return editor;
|
|
12404
12404
|
}
|
|
12405
|
+
const editorState = get$8(editor.uid);
|
|
12406
|
+
if (!editorState) {
|
|
12407
|
+
return editor;
|
|
12408
|
+
}
|
|
12409
|
+
const offsetAtCursor = getOffsetAtCursor$1(editor);
|
|
12410
|
+
const prepareRenameResult = await execute({
|
|
12411
|
+
args: [offsetAtCursor],
|
|
12412
|
+
editor,
|
|
12413
|
+
kind: 'rename',
|
|
12414
|
+
method: 'prepareRename'
|
|
12415
|
+
});
|
|
12416
|
+
if (!prepareRenameResult || typeof prepareRenameResult !== 'object') {
|
|
12417
|
+
return editor;
|
|
12418
|
+
}
|
|
12419
|
+
const latestEditor = get$8(editor.uid)?.newState;
|
|
12420
|
+
if (latestEditor !== editor) {
|
|
12421
|
+
return latestEditor || editor;
|
|
12422
|
+
}
|
|
12405
12423
|
const fullFocus = true;
|
|
12406
12424
|
let editorWithRenameWidget;
|
|
12407
12425
|
try {
|
|
@@ -16406,7 +16424,7 @@ const getSavedLanguageId = (savedState, languages) => {
|
|
|
16406
16424
|
}
|
|
16407
16425
|
return explicitLanguageId;
|
|
16408
16426
|
};
|
|
16409
|
-
const loadContent = async (state, savedState, largeFile = false, focus = true) => {
|
|
16427
|
+
const loadContent = async (state, savedState, largeFile = false, focus = true, forceReload = false) => {
|
|
16410
16428
|
const {
|
|
16411
16429
|
assetDir,
|
|
16412
16430
|
height,
|
|
@@ -16484,11 +16502,13 @@ const loadContent = async (state, savedState, largeFile = false, focus = true) =
|
|
|
16484
16502
|
tokenizerId: state.tokenizerId
|
|
16485
16503
|
};
|
|
16486
16504
|
let existingEditor;
|
|
16487
|
-
|
|
16488
|
-
const
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16505
|
+
if (!forceReload) {
|
|
16506
|
+
for (const key of getKeys$2()) {
|
|
16507
|
+
const editor = get$8(Number(key))?.newState;
|
|
16508
|
+
if (editor && editor.id !== id && !editor.initial && editor.uri === uri && editor.applicationId === state.applicationId) {
|
|
16509
|
+
existingEditor = editor;
|
|
16510
|
+
break;
|
|
16511
|
+
}
|
|
16492
16512
|
}
|
|
16493
16513
|
}
|
|
16494
16514
|
let content = existingEditor ? getText$1(existingEditor) : '';
|