From 0256c89bc60046bcf8cb92bb3cafc7248ac7c151 Mon Sep 17 00:00:00 2001 From: James Long Date: Thu, 3 Mar 2016 12:19:09 -0500 Subject: [PATCH] Bug 1251823 - fix adding breakpoints through context menu in debugger r=me --- devtools/client/debugger/content/views/sources-view.js | 2 +- devtools/client/debugger/debugger-view.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/devtools/client/debugger/content/views/sources-view.js b/devtools/client/debugger/content/views/sources-view.js index 88b7eb7cc72a..b08bc8a72e4c 100644 --- a/devtools/client/debugger/content/views/sources-view.js +++ b/devtools/client/debugger/content/views/sources-view.js @@ -1147,7 +1147,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, { */ _onCmdAddBreakpoint: function(e) { let actor = this.selectedValue; - let line = (e && e.sourceEvent.target.tagName == 'menuitem' ? + let line = (this.DebuggerView.clickedLine ? this.DebuggerView.clickedLine + 1 : this.DebuggerView.editor.getCursor().line + 1); let location = { actor, line }; diff --git a/devtools/client/debugger/debugger-view.js b/devtools/client/debugger/debugger-view.js index a113aae24239..e1cabb875be4 100644 --- a/devtools/client/debugger/debugger-view.js +++ b/devtools/client/debugger/debugger-view.js @@ -337,6 +337,10 @@ var DebuggerView = { } } }); + + this.editor.on("cursorActivity", () => { + this.clickedLine = null; + }); }, updateEditorBreakpoints: function(source) {