mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-61798 After using RM for a while, I sometimes lose part of the chrome
Added check for the logical line number correctness
This commit is contained in:
@@ -238,14 +238,14 @@ public class SegmentArray {
|
||||
|
||||
public int getSegmentStart(int index) {
|
||||
if (index < 0 || index >= mySegmentCount) {
|
||||
throw new IndexOutOfBoundsException("Wrong line: " + index);
|
||||
throw new IndexOutOfBoundsException("Wrong line: " + index + ". Available lines count: " + mySegmentCount);
|
||||
}
|
||||
return myStarts[index];
|
||||
}
|
||||
|
||||
public int getSegmentEnd(int index) {
|
||||
if (index < 0 || index >= mySegmentCount) {
|
||||
throw new IndexOutOfBoundsException("Wrong line: " + index);
|
||||
throw new IndexOutOfBoundsException("Wrong line: " + index + ". Available lines count: " + mySegmentCount);
|
||||
}
|
||||
return myEnds[index];
|
||||
}
|
||||
|
||||
@@ -1603,6 +1603,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
if (!getFoldingModel().isOffsetCollapsed(startOffset)) {
|
||||
if (visibleStartLine >= startLineNumber && visibleStartLine <= endLineNumber) {
|
||||
int logStartLine = offsetToLogicalPosition(startOffset).line;
|
||||
if (logStartLine >= myDocument.getLineCount()) {
|
||||
return;
|
||||
}
|
||||
LogicalPosition logPosition = offsetToLogicalPosition(myDocument.getLineEndOffset(logStartLine));
|
||||
Point end = logicalPositionToXY(logPosition);
|
||||
int charWidth = EditorUtil.getSpaceWidth(Font.PLAIN, this);
|
||||
|
||||
Reference in New Issue
Block a user