Closed Bug 1545129 Opened 5 years ago Closed 5 years ago

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

Categories

(DevTools :: Debugger, defect, P1)

defect

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: jlast, Assigned: chujunlu)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

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

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

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
Status: NEW → RESOLVED
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.

Attachment

General

Creator:
Created:
Updated:
Size: