Skip to content

Commit

Permalink
Merge branch 'main' of github.com:executablebooks/thebe
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejpurves committed Mar 15, 2024
2 parents 0757602 + e86cedd commit 93e17f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/thebe/src/codemirror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ export function setupCodemirror(
// TODO enable loading of mode js files via configuration
// see https://github.com/jupyterlab/jupyterlab/blob/3.6.x/packages/codemirror/src/mode.ts for
// an example of how to do this
ref.cm?.setOption('mode', codeMirrorConfig.mode);
ref.cm.setOption('mode', codeMirrorConfig.mode);

// All cells in the notebook automatically update their sources on change
ref?.cm?.on('change', () => {
const code = ref?.cm?.getValue();
ref.cm.on('change', () => {
const code = ref.cm.getValue();
cell.source = code;
ref?.cm?.refresh();
ref.cm.refresh();
});

if (codeMirrorConfig.readOnly) {
ref.cm?.display.lineDiv.setAttribute('data-readonly', 'true');
ref.cm.display.lineDiv.setAttribute('data-readonly', 'true');
editorEl.setAttribute('data-readonly', 'true');
cellEl.setAttribute('data-readonly', 'true');
}
Expand Down

0 comments on commit 93e17f0

Please sign in to comment.