Closed Bug 1900684 Opened 4 months ago Closed 3 months ago

CodeMirror6: Selecting text and changing the source leads to a blank editor

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox129 fixed)

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: jdescottes, Assigned: bomsy)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

STRs:

  • enable code mirror 6 (devtools.debugger.features.codemirror-next = true)
  • open devtools > debugger
  • open 2 sources
  • on the selected source, select some text
  • switch to the other source

ER: Source should be displayed
AR: Editor is blank

Clicking anywhere in the editor fixes the issue.

Attached video cm6_blank_editor.mp4
Severity: -- → S3
Priority: -- → P2

The issue here is a selection becomes stale once the editor content changes, and codemirror
no longer knows how to render the old selection with the new content (causing blank editor).
Once the user clicks, this resets the selection which causes the editor content to display properly.

To fix this we reset the selection as we reset the editor content.
Unfortunately we lose the previous selection (even if we go back).

Depends on D213872

Assignee: nobody → hmanilla
Status: NEW → ASSIGNED
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8611db0b6023
[devtools] Reset the selection when changing editor content r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
No longer blocks: 1773246
QA Whiteboard: [qa-129b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: