Skip to content

Commit a9bb058

Browse files
chore: init editor options after init
1 parent 3ad5b89 commit a9bb058

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/executable-code/executable-fragment.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)