Merge pull request #517 from ethereum/dontstopdebuggingifswitchfile

Do not autocompile when switching tab, if we are in a debug session
pull/1/head
chriseth 8 years ago committed by GitHub
commit 97d5f5a4bc
  1. 3
      src/app.js
  2. 6
      src/app/debugger.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) {

@ -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)

Loading…
Cancel
Save