Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Composer/packages/lib/code-editor/src/BaseEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { Diagnostic } from '@bfc/shared';
import { findErrors, combineSimpleMessage, findWarnings } from '@bfc/indexers';
import { CodeEditorSettings, assignDefined } from '@bfc/shared';

import { isElectron } from './utils';

const defaultOptions = {
scrollBeyondLastLine: false,
wordWrap: 'off',
Expand All @@ -32,6 +34,7 @@ const defaultOptions = {
renderLineHighlight: 'none',
formatOnType: true,
fixedOverflowWidgets: true,
links: isElectron() ? false : true, // disable in electron@8.2.4 before monaco editor can set target '_blank'
};

const styles = {
Expand Down
5 changes: 5 additions & 0 deletions Composer/packages/lib/code-editor/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
export function processSize(size) {
return !/^\d+$/.test(size) ? size : `${size}px`;
}

export function isElectron(): boolean {
// eslint-disable-next-line no-prototype-builtins
return window.hasOwnProperty('__IS_ELECTRON__');
Comment thread
a-b-r-o-w-n marked this conversation as resolved.
Outdated
}