public void TwoKeysToEscape() { Create(ModeArgument.NewInsertWithCount(2), "hello"); _vimBuffer.Vim.KeyMap.MapWithNoRemap("jj", "<Esc>", KeyRemapMode.Insert); _vimBuffer.Process("jj"); Assert.Equal(ModeKind.Normal, _vimBuffer.ModeKind); }
public void KeyRemap_TwoKeysToEscape() { Create("hello"); _buffer.Vim.KeyMap.MapWithNoRemap("jj", "<Esc>", KeyRemapMode.Insert); _buffer.SwitchMode(ModeKind.Insert, ModeArgument.NewInsertWithCount(2)); _buffer.Process("jj"); Assert.AreEqual(ModeKind.Normal, _buffer.ModeKind); }
public void InsertOverAsCommand() { Create("fish tree"); _vimBuffer.SwitchMode(ModeKind.Replace, ModeArgument.NewInsertWithCount(2)); _vimBuffer.Process("cat"); _vimBuffer.Process(VimKey.Escape); Assert.Equal("catcatree", _textBuffer.GetLine(0).GetText()); Assert.Equal(5, _textView.GetCaretPoint().Position); }
public void Repeat_InsertText() { Create("dog"); _buffer.SwitchMode(ModeKind.Replace, ModeArgument.NewInsertWithCount(2)); _buffer.Process("cat"); _buffer.Process(VimKey.Escape); Assert.AreEqual("catcat", _textView.GetLine(0).GetText()); Assert.AreEqual(5, _textView.GetCaretPoint().Position); }
public void Repeat_Delete() { Create(ModeArgument.NewInsertWithCount(2), "doggie"); _textView.MoveCaretTo(1); _vimBuffer.Process(VimKey.Delete); _vimBuffer.Process(VimKey.Escape); Assert.Equal("dgie", _textView.GetLine(0).GetText()); Assert.Equal(0, _textView.GetCaretPoint().Position); }
public void Repeat_Insert() { Create(ModeArgument.NewInsertWithCount(2), "the cat"); _vimBuffer.Process("hi"); Assert.Equal(2, _textView.GetCaretPoint().Position); _vimBuffer.Process(VimKey.Escape); Assert.Equal("hihithe cat", _textView.GetLine(0).GetText()); Assert.Equal(3, _textView.GetCaretPoint().Position); }
public void Repeat_WhiteSpaceChange() { Create(ModeArgument.NewInsertWithCount(2), "blue\t\t dog"); _vimBuffer.LocalSettings.TabStop = 4; _vimBuffer.LocalSettings.ExpandTab = false; _textView.MoveCaretTo(10); _textBuffer.Replace(new Span(6, 4), "\t\t"); _textView.MoveCaretTo(8); Assert.Equal("blue\t\t\t\tdog", _textBuffer.GetLine(0).GetText()); _vimBuffer.Process(VimKey.Escape); Assert.Equal("blue\t\t\t\t\tdog", _textBuffer.GetLine(0).GetText()); }