File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,11 @@ export default class ExecutableFragment extends ExecutableCodeTemplate {
418418 codemirrorOptions . cursorBlinkRate = - 1 ;
419419 }
420420
421+ this . codemirror = CodeMirror . fromTextArea ( textarea , codemirrorOptions ) ;
422+
423+ // don't need to create additional editor options in readonly mode.
424+ if ( readOnly ) return ;
425+
421426 /**
422427 * Register own helper for autocomplete.
423428 * Getting completions from try.kotlinlang.org.
@@ -471,8 +476,6 @@ export default class ExecutableFragment extends ExecutableCodeTemplate {
471476 CodeMirror . showHint ( cm , CodeMirror . hint . kotlin ) ;
472477 } ;
473478
474- this . codemirror = CodeMirror . fromTextArea ( textarea , codemirrorOptions ) ;
475-
476479 if ( window . navigator . appVersion . indexOf ( "Mac" ) !== - 1 ) {
477480 this . codemirror . setOption ( "extraKeys" , {
478481 "Cmd-Alt-L" : "indentAuto" ,
You can’t perform that action at this time.
0 commit comments