Skip to content

Commit 93e17f0

Browse files
committed
Merge branch 'main' of github.com:executablebooks/thebe
2 parents 0757602 + e86cedd commit 93e17f0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/thebe/src/codemirror.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,17 @@ export function setupCodemirror(
132132
// TODO enable loading of mode js files via configuration
133133
// see https://github.com/jupyterlab/jupyterlab/blob/3.6.x/packages/codemirror/src/mode.ts for
134134
// an example of how to do this
135-
ref.cm?.setOption('mode', codeMirrorConfig.mode);
135+
ref.cm.setOption('mode', codeMirrorConfig.mode);
136136

137137
// All cells in the notebook automatically update their sources on change
138-
ref?.cm?.on('change', () => {
139-
const code = ref?.cm?.getValue();
138+
ref.cm.on('change', () => {
139+
const code = ref.cm.getValue();
140140
cell.source = code;
141-
ref?.cm?.refresh();
141+
ref.cm.refresh();
142142
});
143143

144144
if (codeMirrorConfig.readOnly) {
145-
ref.cm?.display.lineDiv.setAttribute('data-readonly', 'true');
145+
ref.cm.display.lineDiv.setAttribute('data-readonly', 'true');
146146
editorEl.setAttribute('data-readonly', 'true');
147147
cellEl.setAttribute('data-readonly', 'true');
148148
}

0 commit comments

Comments
 (0)