public void SmallDelete() { var reg = _map.GetRegister('c'); _map.SetRegisterValue(reg, RegisterOperation.Delete, RegisterValue.OfString("foo", OperationKind.CharacterWise)); AssertRegister(RegisterName.SmallDelete, "foo", OperationKind.CharacterWise); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public static void UpdateValue(this Register reg, string value, OperationKind kind) { reg.RegisterValue = RegisterValue.OfString(value, kind); }
public void StarRegister2() { _clipboard.SetupSet(x => x.Text = "bar").Verifiable(); _map.GetRegister('*').RegisterValue = RegisterValue.OfString("bar", OperationKind.CharacterWise); _factory.Verify(); }