@lvce-editor/editor-worker 19.55.0 → 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.
@@ -4636,6 +4636,7 @@ const getLine = (lineState, embeddedResults, tokenMap, lineLength) => {
4636
4636
  };
4637
4637
  const getMinimapLines = async (editor, syncIncremental) => {
4638
4638
  const {
4639
+ languageId,
4639
4640
  lines
4640
4641
  } = editor;
4641
4642
  if (lines.length === 0) {
@@ -4646,8 +4647,7 @@ const getMinimapLines = async (editor, syncIncremental) => {
4646
4647
  await loadTokenizers(result.tokenizersToLoad);
4647
4648
  result = await getTokensViewport2(editor, 0, lines.length, syncIncremental);
4648
4649
  }
4649
- const tokenizer = get$4(editor.tokenizerId);
4650
- const tokenMap = tokenizer.TokenMap || {};
4650
+ const tokenMap = get$5(languageId);
4651
4651
  return result.tokens.map((lineState, index) => getLine(lineState, result.embeddedResults, tokenMap, lines[index].length));
4652
4652
  };
4653
4653
 
@@ -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)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.55.0",
3
+ "version": "19.55.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"