Skip to content

Commit

Permalink
ProjectionAnnotationModel.expandAll should tolerate the empty selection
Browse files Browse the repository at this point in the history
- ITextSelection.emptySelection has offset and length -1 so those values
need to be tolerated downstream, included in the recent-optimized
ProjectionAnnotationModel.expandAll method.

eclipse-platform#2257
  • Loading branch information
merks authored and praveen-skp committed Oct 14, 2024
1 parent dd3fd84 commit 3e77e57
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public boolean collapseAll(int offset, int length) {
*/
protected boolean expandAll(int offset, int length, boolean fireModelChanged) {

if (offset < 0 || length < 0) {
return false;
}

boolean expanding= false;

Iterator<Annotation> iterator= getAnnotationIterator(offset, length, true, true);
Expand Down

0 comments on commit 3e77e57

Please sign in to comment.