本文整理汇总了TypeScript中vs/editor/browser/viewParts/lines/viewLines.ViewLines.visibleRangesForRange2方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ViewLines.visibleRangesForRange2方法的具体用法?TypeScript ViewLines.visibleRangesForRange2怎么用?TypeScript ViewLines.visibleRangesForRange2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/editor/browser/viewParts/lines/viewLines.ViewLines
的用法示例。
在下文中一共展示了ViewLines.visibleRangesForRange2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Range
visibleRangeForPositionRelativeToEditor: (lineNumber: number, column: number) => {
this._flushAccumulatedAndRenderNow();
let visibleRanges = this.viewLines.visibleRangesForRange2(new Range(lineNumber, column, lineNumber, column));
if (!visibleRanges) {
return null;
}
return visibleRanges[0];
}
示例2: Error
visibleRangeForPosition2: (lineNumber: number, column: number) => {
if (this._isDisposed) {
throw new Error('ViewImpl.pointerHandler.visibleRangeForPosition2: View is disposed');
}
this._flushAccumulatedAndRenderNow();
let visibleRanges = this.viewLines.visibleRangesForRange2(new Range(lineNumber, column, lineNumber, column), 0);
if (!visibleRanges) {
return null;
}
return visibleRanges[0];
},
示例3: getOffsetForColumn
public getOffsetForColumn(modelLineNumber: number, modelColumn: number): number {
let modelPosition = this._context.model.validateModelPosition({
lineNumber: modelLineNumber,
column: modelColumn
});
let viewPosition = this._context.model.coordinatesConverter.convertModelPositionToViewPosition(modelPosition);
this._flushAccumulatedAndRenderNow();
let visibleRanges = this.viewLines.visibleRangesForRange2(new Range(viewPosition.lineNumber, viewPosition.column, viewPosition.lineNumber, viewPosition.column));
if (!visibleRanges) {
return -1;
}
return visibleRanges[0].left;
}