Closed Bug 1545129 Opened 5 years ago Closed 5 years ago

Conditional Breakpoints - pressing enter in the panel adds a new line


(DevTools :: Debugger, defect, P1)



(firefox68 fixed)

Firefox 68
Tracking Status
firefox68 --- fixed


(Reporter: jlast, Assigned: chujunlu)


(Blocks 1 open bug)


(Keywords: good-first-bug)


(1 file)


  1. right click on a line
  2. select add a conditional breakpoint
  3. type in the panel
  4. move the cursor somewhere in the middle of the text
  5. press enter

ER: saves the condition
AR: saves the condition w/ a new line where the cursor was

Priority: -- → P1
Keywords: good-first-bug

I believe this was introduced with the change to allow the new line for logpoints.

I came up with a different approach to tackle the issue I showed to David in Tuesday's meeting. I'm comparing two implementations. Will send a patch when I'm ready. :)

Thank you Chujun!

Target Milestone: --- → Firefox 66
Target Milestone: Firefox 66 → Firefox 68

The conditional breakpoint panel is wrapped in CodeMirror (starting from When hitting Enter, debugger/node_modules/codemirror/lib/codemirror.js will run line 7153 onKeyDown(), in which a new line is added. Then ConditionalPanel.js onKey() runs.

Solution: Ask CodeMirror not to add a new line when hit Enter.

I added two test cases to Mochitest. If I put a debugger; statement in the test file, ran ./mach mochitest --jsdebugger file/path, keepstep over, all tests pass. But when I ran./mach mochitest same/file/path`, terminal stopped at "waiting for state change" then gave an error "Failed to retrieve MOZ_UPLOAD_DIR env var."

Pushed by
Prevent "Enter" event from adding a new line in CodeMirror r=davidwalsh
Closed: 5 years ago
Resolution: --- → FIXED
Assignee: nobody → chujunlu
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
You need to log in before you can comment on or make changes to this bug.