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

RESOLVED FIXED in Firefox 68

Status

defect
P1
normal
RESOLVED FIXED
2 months ago
Last month

People

(Reporter: jlast, Assigned: chujunlu)

Tracking

(Blocks 1 bug, {good-first-bug})

unspecified
Firefox 68
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

Reporter

Description

2 months ago

STR:

  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

Reporter

Updated

2 months ago
Priority: -- → P1
Reporter

Updated

2 months ago
Keywords: good-first-bug

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

Assignee

Comment 2

2 months ago

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!

Reporter

Updated

2 months ago
Target Milestone: --- → Firefox 66
Reporter

Updated

2 months ago
Target Milestone: Firefox 66 → Firefox 68
Assignee

Comment 4

2 months ago

The conditional breakpoint panel is wrapped in CodeMirror (starting from https://github.com/firefox-devtools/debugger/commit/6b0b968515ee0511899f80feb95a25d1f855073d). 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.

Question:
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."

Comment 5

Last month
Pushed by dwalsh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/178ad5eddb72
Prevent "Enter" event from adding a new line in CodeMirror r=davidwalsh

Comment 6

Last month
bugherder
Status: NEW → RESOLVED
Closed: Last month
Resolution: --- → FIXED
Assignee: nobody → chujunlu
You need to log in before you can comment on or make changes to this bug.