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:
parent
b913e933a9
commit
8fde3d9842
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue