本文整理汇总了TypeScript中vs/editor/common/controller/cursorMoveHelper.CursorMoveHelper.nextTabColumn方法的典型用法代码示例。如果您正苦于以下问题:TypeScript CursorMoveHelper.nextTabColumn方法的具体用法?TypeScript CursorMoveHelper.nextTabColumn怎么用?TypeScript CursorMoveHelper.nextTabColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/editor/common/controller/cursorMoveHelper.CursorMoveHelper
的用法示例。
在下文中一共展示了CursorMoveHelper.nextTabColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: shiftIndentCount
public static shiftIndentCount(line:string, column:number, tabSize:number): number {
// Determine the visible column where the content starts
var contentStartVisibleColumn = CursorMoveHelper.visibleColumnFromColumn2(line, column, tabSize);
var desiredTabStop = CursorMoveHelper.nextTabColumn(contentStartVisibleColumn, tabSize);
// The `desiredTabStop` is a multiple of `tabSize` => determine the number of indents
return desiredTabStop / tabSize;
}
示例2: test
test('nextTabStop', () => {
assert.equal(CursorMoveHelper.nextTabColumn(0, 4), 4);
assert.equal(CursorMoveHelper.nextTabColumn(1, 4), 4);
assert.equal(CursorMoveHelper.nextTabColumn(2, 4), 4);
assert.equal(CursorMoveHelper.nextTabColumn(3, 4), 4);
assert.equal(CursorMoveHelper.nextTabColumn(4, 4), 8);
assert.equal(CursorMoveHelper.nextTabColumn(5, 4), 8);
assert.equal(CursorMoveHelper.nextTabColumn(6, 4), 8);
assert.equal(CursorMoveHelper.nextTabColumn(7, 4), 8);
assert.equal(CursorMoveHelper.nextTabColumn(8, 4), 12);
assert.equal(CursorMoveHelper.nextTabColumn(0, 2), 2);
assert.equal(CursorMoveHelper.nextTabColumn(1, 2), 2);
assert.equal(CursorMoveHelper.nextTabColumn(2, 2), 4);
assert.equal(CursorMoveHelper.nextTabColumn(3, 2), 4);
assert.equal(CursorMoveHelper.nextTabColumn(4, 2), 6);
assert.equal(CursorMoveHelper.nextTabColumn(5, 2), 6);
assert.equal(CursorMoveHelper.nextTabColumn(6, 2), 8);
assert.equal(CursorMoveHelper.nextTabColumn(7, 2), 8);
assert.equal(CursorMoveHelper.nextTabColumn(8, 2), 10);
assert.equal(CursorMoveHelper.nextTabColumn(0, 1), 1);
assert.equal(CursorMoveHelper.nextTabColumn(1, 1), 2);
assert.equal(CursorMoveHelper.nextTabColumn(2, 1), 3);
assert.equal(CursorMoveHelper.nextTabColumn(3, 1), 4);
assert.equal(CursorMoveHelper.nextTabColumn(4, 1), 5);
assert.equal(CursorMoveHelper.nextTabColumn(5, 1), 6);
assert.equal(CursorMoveHelper.nextTabColumn(6, 1), 7);
assert.equal(CursorMoveHelper.nextTabColumn(7, 1), 8);
assert.equal(CursorMoveHelper.nextTabColumn(8, 1), 9);
});