@lvce-editor/editor-worker 19.55.1 → 19.55.2
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 +7 -0
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -6443,6 +6443,10 @@ const getNewEditor = async editor => {
|
|
|
6443
6443
|
return editor;
|
|
6444
6444
|
};
|
|
6445
6445
|
|
|
6446
|
+
const isReadonlyFile = async uri => {
|
|
6447
|
+
return invoke$a('FileSystem.isReadonly', uri);
|
|
6448
|
+
};
|
|
6449
|
+
|
|
6446
6450
|
const isUntitledFile = uri => {
|
|
6447
6451
|
return uri.startsWith('untitled:');
|
|
6448
6452
|
};
|
|
@@ -6505,6 +6509,9 @@ const save = async editor => {
|
|
|
6505
6509
|
platform,
|
|
6506
6510
|
uri
|
|
6507
6511
|
} = editor;
|
|
6512
|
+
if (!isUntitledFile(uri) && (await isReadonlyFile(uri))) {
|
|
6513
|
+
return editor;
|
|
6514
|
+
}
|
|
6508
6515
|
const newEditor = await getNewEditor(editor);
|
|
6509
6516
|
const content = applyLineEndings(getText$1(newEditor), newEditor.endOfLine);
|
|
6510
6517
|
if (isUntitledFile(uri)) {
|