Esempio n. 1
0
 public void OperatorPendingWhenWaitingForMotion()
 {
     Create("hello world");
     _runner.Add(VimUtil.CreateMotionBinding("d"));
     _runner.Run('d');
     Assert.Equal(_runner.KeyRemapMode, KeyRemapMode.OperatorPending);
 }
Esempio n. 2
0
            public void Run_MotionMixedWithNonMotion()
            {
                Create("the dog chased the ball");
                var simple = new[] { "g~g~", "g~~", "gugu", "guu", "gUgU", "gUU" };
                var motion = new[] { "g~", "gu", "gU" };

                foreach (var cur in simple)
                {
                    _runner.Add(VimUtil.CreateNormalBinding(cur));
                }

                foreach (var cur in motion)
                {
                    _runner.Add(VimUtil.CreateMotionBinding(cur));
                }

                foreach (var cur in simple)
                {
                    // Make sure we can run them all
                    Assert.True(_runner.Run(cur).IsComplete);
                }

                foreach (var cur in motion)
                {
                    // Make sure we can run them all
                    Assert.True(_runner.Run(cur).IsNeedMoreInput);
                    _runner.ResetState();
                }
            }
Esempio n. 3
0
 public void OperatorPendingWhenWaitingForMotionLegacy()
 {
     Create("hello world");
     _runner.Add(VimUtil.CreateMotionBinding("d"));
     _runner.Run('d');
     Assert.True(_runner.KeyRemapMode.IsSome(KeyRemapMode.OperatorPending));
 }
Esempio n. 4
0
 public void OperatorPendingWhenAmbiguousBetweenMotionAndCommand()
 {
     Create("hello world");
     _runner.Add(VimUtil.CreateMotionBinding("d"));
     _runner.Add(VimUtil.CreateNormalBinding("dd"));
     _runner.Run('d');
     Assert.Equal(_runner.KeyRemapMode, KeyRemapMode.OperatorPending);
 }
Esempio n. 5
0
 public void IsWaitingForMoreInput5()
 {
     Create("hello world");
     _runner.Add(VimUtil.CreateMotionBinding("cat"));
     Assert.True(Run("cata").IsNeedMoreInput);
     Assert.True(_runner.Run(KeyInputUtil.EscapeKey).IsCancelled);
     Assert.False(_runner.IsWaitingForMoreInput);
 }
Esempio n. 6
0
 public void LanguageInToArgument()
 {
     Create("hello world");
     _runner.Add(VimUtil.CreateMotionBinding("d"));
     _runner.Run('d');
     _runner.Run('f');
     Assert.Equal(KeyRemapMode.Language, _runner.KeyRemapMode);
 }
Esempio n. 7
0
            public void CommandMatch7()
            {
                Create("foo bar");
                var count1 = 0;

                _runner.Add(VimUtil.CreateMotionBinding("aa", data => { count1++; return(NormalCommand.NewYank(data)); }));
                var count2 = 0;

                _runner.Add(VimUtil.CreateNormalBinding("aab", data => { count2++; return(CommandResult.NewCompleted(ModeSwitch.NoSwitch)); }));
                Run("aaw");
                Assert.Equal(1, count1);
                Assert.Equal(0, count2);
            }