Make editors readonly during execution

This commit is contained in:
Nilay Majorwar
2022-01-22 21:57:53 +05:30
parent ffc9c03452
commit 251a6836f5
3 changed files with 19 additions and 3 deletions

View File

@ -137,6 +137,7 @@ export const Mainframe = <RS extends {}>({ langName, provider }: Props<RS>) => {
<CodeEditor
ref={codeEditorRef}
languageId="brainfuck"
readOnly={execController.state === "processing"}
defaultValue={providerRef.current.sampleProgram}
tokensProvider={providerRef.current.editorTokensProvider}
onValidateCode={execController.validateCode}
@ -151,7 +152,12 @@ export const Mainframe = <RS extends {}>({ langName, provider }: Props<RS>) => {
renderer={providerRef.current.Renderer as any}
/>
)}
renderInput={() => <InputEditor ref={inputEditorRef} />}
renderInput={() => (
<InputEditor
ref={inputEditorRef}
readOnly={execController.state === "processing"}
/>
)}
renderOutput={() => <OutputViewer ref={outputEditorRef} />}
renderExecControls={() => (
<ExecutionControls