예제 #1
0
            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);
            }
예제 #2
0
        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));
        }
예제 #3
0
            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'));
            }
예제 #4
0
            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);
            }
예제 #5
0
            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);
            }
예제 #6
0
            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);
            }