diff --git a/public/locales/en-US.json b/public/locales/en-US.json index 438de350a..616317053 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -175,7 +175,8 @@ "themeDark": "Dark", "themeSystem": "System", "theme": "Theme", - "title": "Preferences" + "title": "Preferences", + "useEnhancedEditors": "Use Enhanced Editors" }, "passageEdit": { "editorCrashed": "Something went wrong with this editor. Try closing it and editing this passage again.", diff --git a/src/components/control/code-area/__mocks__/code-area.tsx b/src/components/control/code-area/__mocks__/code-area.tsx index 3aa229534..f289f0fd9 100644 --- a/src/components/control/code-area/__mocks__/code-area.tsx +++ b/src/components/control/code-area/__mocks__/code-area.tsx @@ -3,19 +3,14 @@ import {CodeAreaProps} from '../code-area'; export const CodeArea: React.FC = props => { function handleOnChange(e: React.ChangeEvent) { - props.onBeforeChange( - { - historySize: () => ({ - redo: 0, - undo: 0 - }), - mockCodeMirrorEditor: true - } as any, - { - mockCodeMirrorChange: true - } as any, - e.target.value - ); + props.onChangeEditor?.({ + historySize: () => ({ + redo: 0, + undo: 0 + }), + mockCodeMirrorEditor: true + } as any); + props.onChangeText(e.target.value); } return ( @@ -24,6 +19,7 @@ export const CodeArea: React.FC = props => { data-font-family={props.fontFamily} data-font-scale={props.fontScale} data-options={JSON.stringify(props.options)} + data-use-code-mirror={props.useCodeMirror} >