1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 01:06:01 +02:00

Fix for 183653: While in CDT perspective CTRL^X of 1000 lines out of a 1500 line source file causes error

This commit is contained in:
Anton Leherbauer 2007-04-25 08:27:30 +00:00
parent b913e933a9
commit 8fde3d9842

View file

@ -400,8 +400,11 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
private int getTopIndexStartOffset() {
if (fTextWidget != null) {
int top= fTextWidget.getTopIndex();
top= fTextWidget.getOffsetAtLine(top);
return getDocumentOffset(top);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=183653
top= fTextWidget.getOffsetAtLine(Math.min(fTextWidget.getLineCount() - 1, top));
if (top >= 0) {
return getDocumentOffset(top);
}
}
return -1;
}