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.

#2257
  • Loading branch information
merks committed Oct 4, 2024
1 parent 73b5314 commit ebbc32d
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 ebbc32d

Please sign in to comment.