mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Fix NoSuchElementException if no comment
This commit is contained in:
parent
fc309c3e02
commit
db3183d89f
1 changed files with 13 additions and 11 deletions
|
@ -1252,18 +1252,20 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
|
||||||
comments.add(new Tuple(new CProjectionAnnotation(collapse, doc.get(projection.offset, Math.min(16, projection.length)), true), projection));
|
comments.add(new Tuple(new CProjectionAnnotation(collapse, doc.get(projection.offset, Math.min(16, projection.length)), true), projection));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// first comment is header comment
|
if (!comments.isEmpty()) {
|
||||||
Iterator iter = comments.iterator();
|
// first comment is header comment
|
||||||
Tuple tuple = (Tuple) iter.next();
|
Iterator iter = comments.iterator();
|
||||||
if (ctx.collapseHeaderComments()) {
|
Tuple tuple = (Tuple) iter.next();
|
||||||
tuple.annotation.markCollapsed();
|
if (ctx.collapseHeaderComments()) {
|
||||||
} else {
|
tuple.annotation.markCollapsed();
|
||||||
tuple.annotation.markExpanded();
|
} else {
|
||||||
}
|
tuple.annotation.markExpanded();
|
||||||
ctx.addProjectionRange(tuple.annotation, tuple.position);
|
}
|
||||||
while (iter.hasNext()) {
|
|
||||||
tuple = (Tuple) iter.next();
|
|
||||||
ctx.addProjectionRange(tuple.annotation, tuple.position);
|
ctx.addProjectionRange(tuple.annotation, tuple.position);
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
tuple = (Tuple) iter.next();
|
||||||
|
ctx.addProjectionRange(tuple.annotation, tuple.position);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue