diff --git a/services/web/frontend/js/ide/connection/EditorWatchdogManager.js b/services/web/frontend/js/ide/connection/EditorWatchdogManager.js index d0e367140a..98c93ac51c 100644 --- a/services/web/frontend/js/ide/connection/EditorWatchdogManager.js +++ b/services/web/frontend/js/ide/connection/EditorWatchdogManager.js @@ -177,9 +177,21 @@ export default class EditorWatchdogManager { } attachToEditor(editorName, editor) { - const onChange = change => { - // Ignore remote changes. - if (change.origin !== 'remote') this.onEdit() + let onChange + if (editorName === 'CM') { + // CM is passing the CM instance as first parameter, then the change. + onChange = (editor, change) => { + // Ignore remote changes. + if (change.origin === 'remote') return + this.onEdit() + } + } else { + // ACE is passing the change object as first parameter. + onChange = change => { + // Ignore remote changes. + if (change.origin === 'remote') return + this.onEdit() + } } this._log('attach to editor', editorName) editor.on('change', onChange)