示例#1
0
 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);
 }
示例#3
0
 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);
 }
示例#4
0
 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);
 }
示例#5
0
 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);
 }
示例#6
0
 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);
 }
示例#7
0
 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());
 }