예제 #1
0
            public void SmallDelete()
            {
                var reg = _map.GetRegister('c');

                _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("foo", OperationKind.CharacterWise));
                AssertRegister(RegisterName.SmallDelete, "foo", OperationKind.CharacterWise);
            }
예제 #2
0
파일: RegisterTest.cs 프로젝트: sh54/VsVim
        public void ValueBackingTest1()
        {
            var backing = new MockRegisterValueBacking();
            var reg     = new Register(RegisterName.Unnamed, backing);

            reg.RegisterValue = RegisterValue.OfString("foo", OperationKind.CharacterWise);
            Assert.AreEqual("foo", backing.RegisterValue.StringValue);
        }
예제 #3
0
            public void DeleteSingleLine()
            {
                var reg = _map.GetRegister('c');

                _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("foo bar\n", OperationKind.CharacterWise));
                AssertRegister(reg, "foo bar\n", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Unnamed, "foo bar\n", OperationKind.CharacterWise);
                AssertRegister('1', "foo bar\n", OperationKind.CharacterWise);
            }
예제 #4
0
            public void DeleteOfMultipleLines()
            {
                _map.GetRegister(RegisterName.SmallDelete).UpdateValue("", OperationKind.LineWise);
                var reg  = _map.GetRegister('c');
                var text = "cat" + Environment.NewLine + "dog";

                _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString(text, OperationKind.CharacterWise));
                AssertRegister(RegisterName.SmallDelete, "", OperationKind.LineWise);
            }
예제 #5
0
            public void Yank()
            {
                var reg = _map.GetRegister('c');

                _map.GetRegister(RegisterName.SmallDelete).UpdateValue("", OperationKind.LineWise);
                _map.SetRegisterValue(reg, RegisterOperation.Yank, RegisterValue.OfString("foo bar", OperationKind.CharacterWise));
                AssertRegister(reg, "foo bar", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Unnamed, "foo bar", OperationKind.CharacterWise);
                AssertRegister(RegisterName.SmallDelete, "", OperationKind.LineWise);
            }
예제 #6
0
        public void SetRegisterValue_DeleteSingleLine()
        {
            var reg = _map.GetRegister('c');

            _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("foo bar", OperationKind.CharacterWise));
            AssertRegister(reg, "foo bar", OperationKind.CharacterWise);
            AssertRegister(RegisterName.Unnamed, "foo bar", OperationKind.CharacterWise);
            AssertRegister(RegisterName.NewNumbered(NumberedRegister.Register_1), "foo bar", OperationKind.CharacterWise);
            AssertRegister(RegisterName.SmallDelete, "foo bar", OperationKind.CharacterWise);
        }
예제 #7
0
            public void Numbered()
            {
                var reg = _map.GetRegister('c');

                _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("f\n", OperationKind.CharacterWise));
                _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("o\n", OperationKind.CharacterWise));
                AssertRegister(reg, "o\n", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Unnamed, "o\n", OperationKind.CharacterWise);
                AssertRegister('1', "o\n", OperationKind.CharacterWise);
                AssertRegister('2', "f\n", OperationKind.CharacterWise);
            }
예제 #8
0
            public void ForSpan_DeleteToBlackHole()
            {
                _map.GetRegister(RegisterName.Blackhole).UpdateValue("", OperationKind.LineWise);
                _map.GetRegister(RegisterName.NewNumbered(NumberedRegister.Register_1)).UpdateValue("hey", OperationKind.CharacterWise);
                var namedReg = _map.GetRegister('c');

                _map.SetRegisterValue(namedReg, RegisterOperation.Yank, RegisterValue.OfString("foo bar", OperationKind.CharacterWise));
                _map.SetRegisterValue(_map.GetRegister(RegisterName.Blackhole), RegisterOperation.Delete, RegisterValue.OfString("foo bar", OperationKind.CharacterWise));
                AssertRegister(namedReg, "foo bar", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Unnamed, "foo bar", OperationKind.CharacterWise);
                AssertRegister(RegisterName.NewNumbered(NumberedRegister.Register_1), "hey", OperationKind.CharacterWise);
                AssertRegister(RegisterName.Blackhole, "", OperationKind.LineWise);
            }
예제 #9
0
 public static void UpdateValue(this Register reg, string value, OperationKind kind)
 {
     reg.RegisterValue = RegisterValue.OfString(value, kind);
 }
예제 #10
0
 public void StarRegister2()
 {
     _clipboard.SetupSet(x => x.Text     = "bar").Verifiable();
     _map.GetRegister('*').RegisterValue = RegisterValue.OfString("bar", OperationKind.CharacterWise);
     _factory.Verify();
 }