本文整理汇总了C#中BlockSpan类的典型用法代码示例。如果您正苦于以下问题:C# BlockSpan类的具体用法?C# BlockSpan怎么用?C# BlockSpan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockSpan类属于命名空间,在下文中一共展示了BlockSpan类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateForSelectionPoints_Block_ForwardsMultipleLines
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);
}
示例2: CreateForSelection_Block_Empty
public void CreateForSelection_Block_Empty()
{
Create("hello world");
var visualSpan = VisualSpan.CreateForSelection(_textView, VisualKind.Block);
var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 0, 1);
Assert.AreEqual(blockSpan, visualSpan.AsBlock().Item);
}
示例3: CreateForSelectionPoints_Block_Backwards
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);
}
示例4: CreateForSelectionPoints_Block_Empty
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);
}
示例5: EnterBlock
protected void EnterBlock(BlockSpan blockSpan)
{
var visualSpan = VisualSpan.NewBlock(blockSpan);
var visualSelection = VisualSelection.CreateForward(visualSpan);
visualSelection.SelectAndMoveCaret(_textView);
Assert.False(_context.IsEmpty);
_context.RunAll();
Assert.True(_context.IsEmpty);
_vimBuffer.SwitchMode(ModeKind.VisualBlock, ModeArgument.None);
}
示例6: SimpleCaretPastTab
public void SimpleCaretPastTab()
{
Create("trucker", "\tcat");
var blockSpan = new BlockSpan(_textBuffer.GetPoint(1), tabStop: 2, spaces: 2, height: 2);
var visualSpan = VisualSpan.NewBlock(blockSpan);
visualSpan.Select(_textView, Path.Forward);
// It may seem odd for the second span to start on column 1 since the tab is partially
// included in the line. However Visual Studio has this behavior. It won't select a
// character at the start / end of a selection unless it's completely included
Assert.Equal(
new[]
{
_textBuffer.GetLineSpan(0, 1, 2),
_textBuffer.GetLineSpan(1, 1, 1)
},
_textView.Selection.SelectedSpans);
}
示例7: InitialNonStartPoint
public void InitialNonStartPoint()
{
Create("big cats", "big dogs", "big trees");
var point = _textBuffer.GetPointInLine(1, 3);
_textView.MoveCaretTo(point);
_vimBuffer.ProcessNotation("<C-Q>");
Assert.Equal(ModeKind.VisualBlock, _vimBuffer.ModeKind);
var blockSpan = new BlockSpan(point, tabStop: _tabStop, spaces: 1, height: 1);
Assert.Equal(blockSpan, _vimBuffer.GetSelectionBlockSpan());
}
示例8: InitialState
public void InitialState()
{
Create("hello world");
_vimBuffer.ProcessNotation("<C-Q>");
Assert.Equal(ModeKind.VisualBlock, _vimBuffer.ModeKind);
var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), tabStop: _tabStop, spaces: 1, height: 1);
Assert.Equal(blockSpan, _vimBuffer.GetSelectionBlockSpan());
}
示例9: EnterBlock
private void EnterBlock(BlockSpan blockSpan)
{
var visualSpan = VisualSpan.NewBlock(blockSpan);
var visualSelection = VisualSelection.CreateForVisualSpan(visualSpan);
CommonUtil.SelectAndUpdateCaret(_textView, visualSelection);
Assert.IsFalse(_context.IsEmpty);
_context.RunAll();
Assert.IsTrue(_context.IsEmpty);
_buffer.SwitchMode(ModeKind.VisualBlock, ModeArgument.None);
}
示例10: Backwards
public void Backwards()
{
Create("big cats", "big dogs");
_textView.MoveCaretTo(2);
_vimBuffer.ProcessNotation("<C-Q>jh");
Assert.Equal(ModeKind.VisualBlock, _vimBuffer.ModeKind);
var blockSpan = new BlockSpan(_textView.GetPoint(1), tabStop: _tabStop, spaces: 2, height: 2);
Assert.Equal(blockSpan, _vimBuffer.GetSelectionBlockSpan());
}
示例11: Switch_CharacterToBlock
public void Switch_CharacterToBlock()
{
Create("big dog", "big cat", "big tree", "big fish");
_textView.MoveCaretTo(1);
_vimBuffer.Process("vjl");
Assert.AreEqual(ModeKind.VisualCharacter, _vimBuffer.ModeKind);
_vimBuffer.Process(KeyInputUtil.CharWithControlToKeyInput('q'));
Assert.AreEqual(ModeKind.VisualBlock, _vimBuffer.ModeKind);
var tuple = _vimBuffer.VisualBlockMode.VisualSelection.AsBlock();
var blockSpan = new BlockSpan(
_textBuffer.GetPoint(1),
2,
2);
Assert.AreEqual(blockSpan, tuple.Item1);
Assert.AreEqual(BlockCaretLocation.BottomRight, tuple.Item2);
}
示例12: Select_Block_InitialState
public void Select_Block_InitialState()
{
Create("hello world");
_vimBuffer.ProcessNotation("<C-Q>");
Assert.AreEqual(ModeKind.VisualBlock, _vimBuffer.ModeKind);
var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 1, 1);
Assert.AreEqual(blockSpan, _textView.GetSelectionBlockSpan());
}
示例13: EndPoint_MultiLine
public void EndPoint_MultiLine()
{
Create("cat", "dog", "fish");
var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), 2, 2);
Assert.AreEqual(_textBuffer.GetLine(1).Start.Add(2), blockSpan.End);
}
示例14: Select_Block_Backwards
public void Select_Block_Backwards()
{
Create("big cats", "big dogs");
_textView.MoveCaretTo(2);
_vimBuffer.ProcessNotation("<C-Q>jh");
Assert.AreEqual(ModeKind.VisualBlock, _vimBuffer.ModeKind);
var blockSpan = new BlockSpan(_textView.GetPoint(1), 2, 2);
Assert.AreEqual(blockSpan, _textView.GetSelectionBlockSpan());
}
示例15: BackwardsCaretOnColumnZero
public void BackwardsCaretOnColumnZero()
{
Create("cat", "dog");
var visualSelection = VisualSelection.CreateForPoints(
VisualKind.Block,
_textBuffer.GetPointInLine(0, 1),
_textBuffer.GetPointInLine(1, 0),
tabStop: 4);
var blockSpan = new BlockSpan(_textBuffer.GetPoint(0), tabStop: 4, spaces: 2, height: 2);
Assert.Equal(blockSpan, visualSelection.AsBlock().Item1);
}