File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/app/src/app/components/CodeEditor/CodeMirror Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -303,10 +303,13 @@ class CodemirrorEditor extends React.Component<Props, State> implements Editor {
303303 this . configureEmmet ( ) ;
304304 } ;
305305
306- changeCode = ( code : string = '' ) => {
306+ changeCode = ( code : string = '' , moduleId : string ) => {
307307 const pos = this . codemirror . getCursor ( ) ;
308308 this . codemirror . setCursor ( pos ) ;
309- if ( this . getCode ( ) !== code ) {
309+ if (
310+ code !== this . getCode ( ) &&
311+ ( ! moduleId || this . currentModule . id === moduleId )
312+ ) {
310313 this . codemirror . setValue ( code ) ;
311314 }
312315 } ;
@@ -384,7 +387,7 @@ class CodemirrorEditor extends React.Component<Props, State> implements Editor {
384387
385388 handleChange = ( cm : typeof CodeMirror , change : { origin : string } ) => {
386389 if ( change . origin !== 'setValue' && this . props . onChange ) {
387- this . props . onChange ( cm . getValue ( ) ) ;
390+ this . props . onChange ( cm . getValue ( ) , this . currentModule . shortid ) ;
388391 }
389392 } ;
390393
You can’t perform that action at this time.
0 commit comments