boolean (int startOffset, int endOffset) { assert startOffset >= 0; assert startOffset <= endOffset; assert endOffset <= myEditor.getDocument().getTextLength(); if (myDisabled) return true; if (startOffset < myVisualLineStartOffset || startOffset > myVisualLineEndOffset) { myVisualLineStartOffset = EditorUtil.getNotFoldedLineStartOffset(myEditor, startOffset); myVisualLineEndOffset = EditorUtil.getNotFoldedLineEndOffset(myEditor, startOffset); int visualLine = myEditor.offsetToVisualLine(startOffset); int y = myEditor.visualLineToY(visualLine); myVisualLineClipStartOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(myClipRectangle.x, y))); myVisualLineClipEndOffset = myEditor.logicalPositionToOffset(myEditor.xyToLogicalPosition(new Point(myClipRectangle.x + myClipRectangle.width, y))); } return endOffset > myVisualLineEndOffset || startOffset <= myVisualLineClipEndOffset && endOffset >= myVisualLineClipStartOffset; }