public void PartialTab() { Create("d\tog", "extra"); var column = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(_textBuffer.GetLine(0), spaces: 4, tabStop: 4); Assert.Equal(_textBuffer.GetColumnFromPosition(position: 2), column.Column); }
private SnapshotOverlapColumnSpan GetSpanFromSpaceAndCount(ITextSnapshotLine line, int start, int count, int tabStop) { var startColumn = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(line, start, tabStop); var endColumn = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(line, start + count, tabStop); return(new SnapshotOverlapColumnSpan(startColumn, endColumn, tabStop)); }
public void AfterTab() { Create("d\tog", "extra"); var column = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(_textBuffer.GetLine(0), spaces: 5, tabStop: 4); Assert.Equal(_textBuffer.GetColumnFromPosition(position: 3), column.Column); Assert.True(column.Column.IsCharacter('g')); }
public void Simple() { Create("dog"); var column = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(_textBuffer.GetLine(0), spaces: 0, tabStop: 4); Assert.Equal(4, column.TabStop); Assert.Equal(8, column.WithTabStop(8).TabStop); }
public void PartialTab2() { Create("d\tog", "extra"); var column = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(_textBuffer.GetLine(0), spaces: 2, tabStop: 4); Assert.Equal(1, column.SpacesBefore); Assert.Equal(3, column.TotalSpaces); Assert.Equal(_textBuffer.GetColumnFromPosition(position: 1), column.Column); }
public void WithTab() { Create("\tdog"); var column = SnapshotOverlapColumn.GetColumnForSpacesOrEnd(_textBuffer.GetLine(0), spaces: 2, tabStop: 4); Assert.Equal(4, column.TabStop); Assert.Equal(2, column.SpacesBefore); column = column.WithTabStop(1); Assert.True(column.Column.IsCharacter('o')); Assert.Equal(0, column.SpacesBefore); }