public void MoveCaretToMotionResult11() { Create("dog", "cat", "bear"); var data = VimUtil.CreateMotionResult( _textBuffer.GetLineRange(0, 1).Extent, false, MotionKind.CharacterWiseInclusive); _operations.MoveCaretToMotionResult(data); Assert.AreEqual(Tuple.Create(0, 0), SnapshotPointUtil.GetLineColumn(_textView.GetCaretPoint())); }
public void MoveCaretToMotionResult12() { Create("dog", "cat", "bear"); var data = VimUtil.CreateMotionResult( _textBuffer.GetLineRange(0, 1).ExtentIncludingLineBreak, false, MotionKind.NewLineWise(CaretColumn.NewInLastLine(2))); _operations.MoveCaretToMotionResult(data); Assert.AreEqual(Tuple.Create(0, 2), SnapshotPointUtil.GetLineColumn(_textView.GetCaretPoint())); }
public void MoveCaretToMotionResult10() { Create("foo", "bar", ""); var data = VimUtil.CreateMotionResult( _textBuffer.GetLineRange(0, 1).Extent, true, MotionKind.NewLineWise(CaretColumn.NewInLastLine(0))); _operations.MoveCaretToMotionResult(data); Assert.AreEqual(Tuple.Create(1, 0), SnapshotPointUtil.GetLineColumn(_textView.GetCaretPoint())); }
public static TextSpan ToTextSpan(this SnapshotSpan span) { var start = SnapshotPointUtil.GetLineColumn(span.Start); var option = SnapshotSpanUtil.GetLastIncludedPoint(span); var end = option.IsSome() ? SnapshotPointUtil.GetLineColumn(option.Value) : start; return(new TextSpan { iStartLine = start.Item1, iStartIndex = start.Item2, iEndLine = end.Item1, iEndIndex = end.Item2 }); }
internal bool NavigateTo(VirtualSnapshotPoint point) { var tuple = SnapshotPointUtil.GetLineColumn(point.Position); var line = tuple.Item1; var column = tuple.Item2; var vsBuffer = _vsAdapter.EditorAdapter.GetBufferAdapter(point.Position.Snapshot.TextBuffer); var viewGuid = VSConstants.LOGVIEWID_Code; var hr = _textManager.NavigateToLineAndColumn( vsBuffer, ref viewGuid, line, column, line, column); return(ErrorHandler.Succeeded(hr)); }