Skip to content
Browse files

fix setting disabled breakpoints with mouse

  • Loading branch information...
1 parent 6492214 commit 52c319e31a653216f9326b55e093e8ca205c5813 @nightwing nightwing committed Nov 20, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 plugins-client/ext.debugger/breakpoints.js
View
12 plugins-client/ext.debugger/breakpoints.js
@@ -155,18 +155,20 @@ module.exports = {
var session = editor.session;
var bp = session.getBreakpoints()[row];
- var i = bp ? bp.indexOf("disabled") == -1 ? 1 : 2 : 0;
- if (e.getShiftKey())
- i = (i + 1) %3;
- bp = [" ace_breakpoint ", " ace_breakpoint disabled ", null][i];
+ if (e.getShiftKey()) {
+ var isDisabled = bp && bp.indexOf("disabled") != -1;
+ bp = isDisabled ? " ace_breakpoint " : " ace_breakpoint disabled";
+ } else {
+ bp = bp ? "" : " ace_breakpoint ";
+ }
session.setBreakpoint(row, bp);
_self.addBreakpointToModel(session, row);
});
},
initSession: function(session) {
session.$breakpointListener = function(e) {
- if (!this.c9doc.isInited || !this.$breakpoints.length)
+ if (!this.c9doc || !this.c9doc.isInited || !this.$breakpoints.length)
return;
var delta = e.data;
var range = delta.range;

0 comments on commit 52c319e

Please sign in to comment.
Something went wrong with that request. Please try again.