Ejemplo n.º 1
0
                public void EndOfSnapshot()
                {
                    Create("cat", "dog");
                    var point      = new SnapshotPoint(_textBuffer.CurrentSnapshot, _textBuffer.CurrentSnapshot.Length);
                    var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Line, point, point, _vimBuffer.LocalSettings.TabStop);

                    Assert.Equal(1, visualSpan.AsLine().LineRange.LastLineNumber);
                }
Ejemplo n.º 2
0
                public void Backwards()
                {
                    Create("big cat", "big dog");
                    var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(2), _textBuffer.GetPoint(0), _vimBuffer.LocalSettings.TabStop);
                    var blockSpan  = new BlockSpan(_textBuffer.GetPoint(0), _vimBuffer.LocalSettings.TabStop, 2, 1);

                    Assert.Equal(blockSpan, visualSpan.AsBlock().BlockSpan);
                }
Ejemplo n.º 3
0
                public void SamePoint()
                {
                    Create("cat", "dog", "tree");
                    var point      = _textBuffer.GetLine(1).Start;
                    var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Line, point, point, _vimBuffer.LocalSettings.TabStop);

                    Assert.Equal(_textBuffer.GetLineRange(1), visualSpan.AsLine().LineRange);
                }
Ejemplo n.º 4
0
                public void ForwardsMultipleLines()
                {
                    Create("big cat", "big dog");
                    var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(1), _textBuffer.GetPointInLine(1, 3), _vimBuffer.LocalSettings.TabStop);
                    var blockSpan  = new BlockSpan(_textBuffer.GetPoint(1), _vimBuffer.LocalSettings.TabStop, 2, 2);

                    Assert.Equal(blockSpan, visualSpan.AsBlock().BlockSpan);
                }
Ejemplo n.º 5
0
        public void CreateForSelectionPoints_Block_ForwardsMultipleLines()
        {
            Create("big cat", "big dog");
            var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(1), _textBuffer.GetPointInLine(1, 3));
            var blockSpan  = new BlockSpan(_textBuffer.GetPoint(1), 2, 2);

            Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
        }
Ejemplo n.º 6
0
        public void CreateForSelectionPoints_Block_Backwards()
        {
            Create("big cat", "big dog");
            var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, _textBuffer.GetPoint(2), _textBuffer.GetPoint(0));
            var blockSpan  = new BlockSpan(_textBuffer.GetPoint(0), 2, 1);

            Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
        }
Ejemplo n.º 7
0
                public void Empty()
                {
                    Create("dog cat");
                    var point      = _textBuffer.GetPoint(2);
                    var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Character, point, point, _vimBuffer.LocalSettings.TabStop);

                    Assert.Equal(point, visualSpan.AsCharacter().CharacterSpan.Start);
                    Assert.Equal(0, visualSpan.AsCharacter().CharacterSpan.Length);
                }
Ejemplo n.º 8
0
                public void Empty()
                {
                    Create("dog cat");
                    var point      = _textBuffer.GetPoint(2);
                    var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, point, point, _vimBuffer.LocalSettings.TabStop);
                    var blockSpan  = new BlockSpan(point, _vimBuffer.LocalSettings.TabStop, spaces: 1, height: 1);

                    Assert.Equal(blockSpan, visualSpan.AsBlock().BlockSpan);
                }
Ejemplo n.º 9
0
        public void CreateForSelectionPoints_Character_Empty()
        {
            Create("dog cat");
            var point      = _textBuffer.GetPoint(2);
            var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Character, point, point);

            Assert.Equal(point, visualSpan.AsCharacter().Item.Start);
            Assert.Equal(0, visualSpan.AsCharacter().Item.Length);
        }
Ejemplo n.º 10
0
        public void CreateForSelectionPoints_Block_Empty()
        {
            Create("dog cat");
            var point      = _textBuffer.GetPoint(2);
            var visualSpan = VisualSpan.CreateForSelectionPoints(VisualKind.Block, point, point);
            var blockSpan  = new BlockSpan(point, 0, 1);

            Assert.Equal(blockSpan, visualSpan.AsBlock().Item);
        }