MCPcopy Index your code
hub / github.com/Acode-Foundation/Acode / applyCurrentEditorOptions

Function applyCurrentEditorOptions

src/lib/editorManager.js:1430–1452  ·  view source on GitHub ↗
(file, { forceOptions = false } = {})

Source from the content-addressed store, hash-verified

1428 }
1429
1430 function applyCurrentEditorOptions(file, { forceOptions = false } = {}) {
1431 touchSelectionController?.onSessionChanged();
1432 const optionsSignature = getEditorOptionsSignature();
1433 if (forceOptions || file.__cmOptionsSignature !== optionsSignature) {
1434 const desiredTheme = appSettings?.value?.editorTheme;
1435 if (desiredTheme) editor.setTheme(desiredTheme);
1436 applyOptions();
1437 file.__cmOptionsSignature = optionsSignature;
1438 }
1439 try {
1440 const ro = !file.editable || !!file.loading;
1441 editor.dispatch({
1442 effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(ro)),
1443 });
1444 file.session = editor.state;
1445 } catch (error) {
1446 warnRecoverable(
1447 "Failed to apply read-only compartment update.",
1448 error,
1449 "readonly-reconfigure",
1450 );
1451 }
1452 }
1453
1454 function showLoadingEditor(file) {
1455 const loadingState = EditorState.create({

Callers 1

applyFileToEditorFunction · 0.85

Calls 4

applyOptionsFunction · 0.85
warnRecoverableFunction · 0.85
onSessionChangedMethod · 0.80

Tested by

no test coverage detected