diff --git a/src/app.js b/src/app.js index 59ddc20b7e..eaf2e885e7 100644 --- a/src/app.js +++ b/src/app.js @@ -380,7 +380,6 @@ var run = function () { var fileNames = Object.keys(files.list()) $filesEl.find('.file').remove() - $('#output').empty() for (var f in fileNames) { var name = fileNames[f] @@ -815,6 +814,8 @@ var run = function () { }) function runCompiler () { + if (transactionDebugger.isActive) return + editorSyncFile() var currentFile = ui.get('currentFile') if (currentFile) { diff --git a/src/app/debugger.js b/src/app/debugger.js index 01fad6d1d1..035649a6a7 100644 --- a/src/app/debugger.js +++ b/src/app/debugger.js @@ -11,6 +11,7 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) { this.sourceMappingDecoder = new remix.util.SourceMappingDecoder() this.el.appendChild(this.debugger.render()) this.appAPI = appAPI + this.isActive = false this.breakPointManager = new remix.code.BreakpointManager(this.debugger, (sourceLocation) => { return appAPI.offsetToLineColumn(sourceLocation, sourceLocation.file, this.editor, this.appAPI.lastCompilationResult().data) @@ -33,8 +34,13 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) { self.switchProvider(context) }) + this.debugger.event.register('newTraceLoaded', this, function () { + self.isActive = true + }) + this.debugger.event.register('traceUnloaded', this, function () { self.appAPI.currentSourceLocation(null) + self.isActive = false }) // unload if a file has changed (but not if tabs were switched)