internal static MotionData CreateMotionData( Motion motion, MotionArgument argument = null) { argument = argument ?? new MotionArgument(MotionContext.AfterOperator, FSharpOption <int> .None, FSharpOption <int> .None); return(new MotionData(motion, argument)); }
public void Motion_G() { var util = new Mock<IMotionUtil>(MockBehavior.Strict); Create(util.Object, "hello world"); var span = _textView.GetLine(0).Extent; var arg = new MotionArgument(MotionContext.AfterOperator, FSharpOption<int>.None, FSharpOption<int>.None); util .Setup(x => x.GetMotion(Motion.LineOrLastToFirstNonBlank, arg)) .Returns(FSharpOption.Create(VimUtil.CreateMotionResult(span, motionKind: MotionKind.NewLineWise(CaretColumn.None)))); _commandUtil .Setup(x => x.RunCommand(It.Is<Command>(y => y.AsNormalCommand().Item2.Count.IsNone()))) .Returns(CommandResult.NewCompleted(ModeSwitch.NoSwitch)) .Verifiable(); _mode.Process("yG"); util.Verify(); _commandUtil.Verify(); }
/// <summary> /// Run the specified motion with default arguments /// </summary> public static FSharpOption <MotionResult> GetMotion(this IMotionUtil motionUtil, Motion motion) { var arg = new MotionArgument(MotionContext.AfterOperator, FSharpOption <int> .None, FSharpOption <int> .None); return(motionUtil.GetMotion(motion, arg)); }