diff --git a/assets/css/browser-solidity.css b/assets/css/browser-solidity.css index 90267a78d3..3b09d72e68 100644 --- a/assets/css/browser-solidity.css +++ b/assets/css/browser-solidity.css @@ -487,3 +487,7 @@ input[type="file"] { background-color:#F4B9B7; opacity: 0.5; } + +.ace_gutter-cell.ace_breakpoint{ + background-color: #F77E79; +} diff --git a/src/app/debugger.js b/src/app/debugger.js index 3d2dca828d..50690a4dbe 100644 --- a/src/app/debugger.js +++ b/src/app/debugger.js @@ -11,28 +11,28 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) { this.sourceMappingDecoder = new remix.util.SourceMappingDecoder() this.el.appendChild(this.debugger.render()) this.appAPI = appAPI - this.markers = {} + this.breakPointManager = new remix.code.BreakpointManager(this.debugger, (sourceLocation) => { - return this.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this.editor, this.compiler.lastCompilationResult.data) + return appAPI.offsetToLineColumn(sourceLocation, sourceLocation.file, this.editor, this.appAPI.lastCompilationResult().data) }) this.debugger.setBreakpointManager(this.breakPointManager) this.breakPointManager.event.register('breakpointHit', (sourceLocation) => { }) + var self = this editorEvent.register('breakpointCleared', (fileName, row) => { - if (self.compiler.lastCompilationResult.data) { + if (self.appAPI.lastCompilationResult().data) { this.breakPointManager.remove({fileName: fileName, row: row}) } }) editorEvent.register('breakpointAdded', (fileName, row) => { - if (self.compiler.lastCompilationResult.data) { + if (self.appAPI.lastCompilationResult().data) { this.breakPointManager.add({fileName: fileName, row: row}) } }) - var self = this executionContextEvent.register('contextChanged', this, function (context) { self.switchProvider(context) }) @@ -44,7 +44,6 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) { // unload if a file has changed (but not if tabs were switched) editorEvent.register('contentChanged', function () { self.debugger.unLoad() - self.removeMarkers() }) // register selected code item, highlight the corresponding source location @@ -77,16 +76,6 @@ Debugger.prototype.debug = function (txHash) { }) } -Debugger.prototype.switchFile = function (rawLocation) { - var name = this.editor.getCacheFile() // current opened tab - if (this.compiler.lastCompilationResult.data) { - var source = this.compiler.lastCompilationResult.data.sourceList[rawLocation.file] // auto switch to that tab - if (name !== source) { - this.switchToFile(source) // command the app to swicth to the next file - } - } -} - /** * add a new web3 provider to remix * diff --git a/src/app/editor.js b/src/app/editor.js index 757e7cdd8c..ee500b60b4 100644 --- a/src/app/editor.js +++ b/src/app/editor.js @@ -28,14 +28,14 @@ function Editor () { var breakpoints = e.editor.session.getBreakpoints() for (var k in breakpoints) { if (k === row.toString()) { - event.trigger('breakpointCleared', [self.getCacheFile(), row]) + event.trigger('breakpointCleared', [currentSession, row]) e.editor.session.clearBreakpoint(row) e.stop() return } } self.setBreakpoint(row) - event.trigger('breakpointAdded', [self.getCacheFile(), row]) + event.trigger('breakpointAdded', [currentSession, row]) e.stop() })