794
*/
795
public getWhitespaceAtVerticalOffset(verticalOffset: number): IViewWhitespaceViewportData | null {
797
>
798
>
const candidateIndex = this.getWhitespaceIndexAtOrAfterVerticallOffset(verticalOffset);
799
>
800
>
if (candidateIndex < 0) {
801
>
return null;
802
>
}
803
>
804
>
if (candidateIndex >= this.getWhitespacesCount()) {
805
return null;
806
}
808
>
const candidateTop = this.getVerticalOffsetForWhitespaceIndex(candidateIndex);
809
>
810
>
if (candidateTop > verticalOffset) {
811
>
return null;
812
>
}
813
>
814
>
const candidateHeight = this.getHeightForWhitespaceIndex(candidateIndex);
815
>
const candidateId = this.getIdForWhitespaceIndex(candidateIndex);
816
>
const candidateAfterLineNumber = this.getAfterLineNumberForWhitespaceIndex(candidateIndex);
817
>
818
>
return {
819
>
id: candidateId,
820
>
afterLineNumber: candidateAfterLineNumber,
821
>
verticalOffset: candidateTop,
822
>
height: candidateHeight
823
>
};
824
>
}
825
826
/**