本文整理汇总了TypeScript中vs/editor/common/viewLayout/linesLayout.LinesLayout.insertWhitespace方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LinesLayout.insertWhitespace方法的具体用法?TypeScript LinesLayout.insertWhitespace怎么用?TypeScript LinesLayout.insertWhitespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/editor/common/viewLayout/linesLayout.LinesLayout
的用法示例。
在下文中一共展示了LinesLayout.insertWhitespace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('LinesLayout getWhitespaceAtVerticalOffset', () => {
let linesLayout = new LinesLayout(10, 10);
let a = linesLayout.insertWhitespace(6, 0, 100, 0);
let b = linesLayout.insertWhitespace(7, 0, 50, 0);
let whitespace = linesLayout.getWhitespaceAtVerticalOffset(0);
assert.equal(whitespace, null);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(59);
assert.equal(whitespace, null);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(60);
assert.equal(whitespace.id, a);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(61);
assert.equal(whitespace.id, a);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(159);
assert.equal(whitespace.id, a);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(160);
assert.equal(whitespace, null);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(161);
assert.equal(whitespace, null);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(169);
assert.equal(whitespace, null);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(170);
assert.equal(whitespace.id, b);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(171);
assert.equal(whitespace.id, b);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(219);
assert.equal(whitespace.id, b);
whitespace = linesLayout.getWhitespaceAtVerticalOffset(220);
assert.equal(whitespace, null);
});
示例2: addWhitespace
public addWhitespace(afterLineNumber: number, ordinal: number, height: number, minWidth: number): number {
return this._linesLayout.insertWhitespace(afterLineNumber, ordinal, height, minWidth);
}