Commit 51c57b3d authored by yann300's avatar yann300

simpler display of breakpoin

parent d79edb90
...@@ -17,14 +17,7 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) { ...@@ -17,14 +17,7 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
}) })
this.debugger.setBreakpointManager(this.breakPointManager) this.debugger.setBreakpointManager(this.breakPointManager)
this.breakPointManager.event.register('breakpointHit', (sourceLocation) => { this.breakPointManager.event.register('breakpointHit', (sourceLocation) => {})
var lineColumnPos = this.offsetToLineColumnConverter.offsetToLineColumn(sourceLocation, sourceLocation.file, this.editor, this.compiler.lastCompilationResult.data)
this.editor.setBreakpoint(lineColumnPos.start.line, 'breakpointTouched')
var self = this
setTimeout(function () {
self.editor.setBreakpoint(lineColumnPos.start.line, 'breakpointUntouched')
}, 5000)
})
function convertSourceLocation (self, fileName, row) { function convertSourceLocation (self, fileName, row) {
var source = {} var source = {}
...@@ -39,11 +32,15 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) { ...@@ -39,11 +32,15 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
} }
editorEvent.register('breakpointCleared', (fileName, row) => { editorEvent.register('breakpointCleared', (fileName, row) => {
this.breakPointManager.remove(convertSourceLocation(this, fileName, row)) if (self.compiler.lastCompilationResult.data) {
this.breakPointManager.remove(convertSourceLocation(this, fileName, row))
}
}) })
editorEvent.register('breakpointAdded', (fileName, row) => { editorEvent.register('breakpointAdded', (fileName, row) => {
this.breakPointManager.add(convertSourceLocation(this, fileName, row)) if (self.compiler.lastCompilationResult.data) {
this.breakPointManager.add(convertSourceLocation(this, fileName, row))
}
}) })
var self = this var self = this
......
...@@ -24,12 +24,6 @@ function Editor () { ...@@ -24,12 +24,6 @@ function Editor () {
if (target.className.indexOf('ace_gutter-cell') === -1) { if (target.className.indexOf('ace_gutter-cell') === -1) {
return return
} }
if (!editor.isFocused()) {
return
}
if (e.clientX > 25 + target.getBoundingClientRect().left) {
return
}
var row = e.getDocumentPosition().row var row = e.getDocumentPosition().row
var brkpoints = e.editor.session.getBreakpoints() var brkpoints = e.editor.session.getBreakpoints()
for (var k in brkpoints) { for (var k in brkpoints) {
...@@ -40,7 +34,7 @@ function Editor () { ...@@ -40,7 +34,7 @@ function Editor () {
return return
} }
} }
self.setBreakpoint(row, 'breakpointUntouched') self.setBreakpoint(row)
event.trigger('breakpointAdded', [self.getCacheFile(), row]) event.trigger('breakpointAdded', [self.getCacheFile(), row])
e.stop() e.stop()
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment