forked from mirrors/gecko-dev
Bug 1894659 - [devtools] Fix duplicate breakpoints on really long lines r=devtools-reviewers,nchevobbe
`visibleRanges` can return multiple ranges (mostly for large sources the overflow the current viewport), and those might contain the same line, causing duplicates. Switching from cm.visibleRanges to cm.viewport Differential Revision: https://phabricator.services.mozilla.com/D209233
This commit is contained in:
parent
395589a0ca
commit
281aa6bac0
1 changed files with 23 additions and 23 deletions
|
|
@ -933,8 +933,9 @@ class Editor extends EventEmitter {
|
|||
// (representing the lines in the current viewport) and generate a new rangeset for updating the line gutter
|
||||
// based on the conditions defined in the markers(for each line) provided.
|
||||
const builder = new RangeSetBuilder();
|
||||
for (const { from, to } of cm.visibleRanges) {
|
||||
for (let pos = from; pos <= to; ) {
|
||||
const { from, to } = cm.viewport;
|
||||
let pos = from;
|
||||
while (pos <= to) {
|
||||
const line = cm.state.doc.lineAt(pos);
|
||||
for (const {
|
||||
lineClassName,
|
||||
|
|
@ -958,7 +959,6 @@ class Editor extends EventEmitter {
|
|||
}
|
||||
pos = line.to + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// To update the state with the newly generated marker range set, a dispatch is called on the view
|
||||
// with an transaction effect created by the lineNumberMarkersCompartment, which is used to update the
|
||||
|
|
|
|||
Loading…
Reference in a new issue