mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-09 11:33:20 +02:00
Fix ordering of highlighting positions
This commit is contained in:
parent
2a13c19e05
commit
cace97bf36
1 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,8 @@
|
||||||
package org.eclipse.cdt.internal.ui.editor;
|
package org.eclipse.cdt.internal.ui.editor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
@ -457,6 +459,13 @@ public class SemanticHighlightingReconciler implements ICReconcilingListener {
|
||||||
newPositions.add(current);
|
newPositions.add(current);
|
||||||
}
|
}
|
||||||
fRemovedPositions= newPositions;
|
fRemovedPositions= newPositions;
|
||||||
|
// positions need to be sorted by ascending offset
|
||||||
|
Collections.sort(fAddedPositions, new Comparator() {
|
||||||
|
public int compare(Object o1, Object o2) {
|
||||||
|
final Position p1= (Position)o1;
|
||||||
|
final Position p2= (Position)o2;
|
||||||
|
return p1.getOffset() - p2.getOffset();
|
||||||
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue