File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments