simpler display of breakpoin

pull/1/head
yann300 8 years ago
parent d79edb9063
commit 51c57b3dd8
  1. 17
      src/app/debugger.js
  2. 8
      src/app/editor.js

@ -17,14 +17,7 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
})
this.debugger.setBreakpointManager(this.breakPointManager)
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)
})
this.breakPointManager.event.register('breakpointHit', (sourceLocation) => {})
function convertSourceLocation (self, fileName, row) {
var source = {}
@ -39,11 +32,15 @@ function Debugger (id, appAPI, executionContextEvent, editorEvent) {
}
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) => {
this.breakPointManager.add(convertSourceLocation(this, fileName, row))
if (self.compiler.lastCompilationResult.data) {
this.breakPointManager.add(convertSourceLocation(this, fileName, row))
}
})
var self = this

@ -24,12 +24,6 @@ function Editor () {
if (target.className.indexOf('ace_gutter-cell') === -1) {
return
}
if (!editor.isFocused()) {
return
}
if (e.clientX > 25 + target.getBoundingClientRect().left) {
return
}
var row = e.getDocumentPosition().row
var brkpoints = e.editor.session.getBreakpoints()
for (var k in brkpoints) {
@ -40,7 +34,7 @@ function Editor () {
return
}
}
self.setBreakpoint(row, 'breakpointUntouched')
self.setBreakpoint(row)
event.trigger('breakpointAdded', [self.getCacheFile(), row])
e.stop()
})

Loading…
Cancel
Save