diff options
author | hluk <hluk@email.cz> | 2013-04-25 17:40:06 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-05-06 08:32:42 +0200 |
commit | cf1b82b1522d21539754698a8222b363abf127e7 (patch) | |
tree | bb23fb4666b1c0f8a39b71850d177975ac57e95a /src/plugins/fakevim/fakevim_test.cpp | |
parent | ceeb03e47a609c942a6a8bb25eaea6def2feaf96 (diff) | |
download | qt-creator-cf1b82b1522d21539754698a8222b363abf127e7.tar.gz |
FakeVim: Emulate insert mode more precisely
Set correct position for commands I, A in visual mode.
Don't repeat insert mode [count] times if cursor moved in insert mode
(or after <C-O> command).
Don't repeat movement in insert mode ([count] is used only to repeat
the first inserted text).
Dot command for insert mode should be cleared if cursor moved and user
started inserting a text.
Change-Id: I4dbd0fa4e7ecedc6623838c9ad855f83276da2ce
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/fakevim/fakevim_test.cpp')
-rw-r--r-- | src/plugins/fakevim/fakevim_test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/fakevim/fakevim_test.cpp b/src/plugins/fakevim/fakevim_test.cpp index 1415e29bf3..ae2a7a31c3 100644 --- a/src/plugins/fakevim/fakevim_test.cpp +++ b/src/plugins/fakevim/fakevim_test.cpp @@ -575,6 +575,21 @@ void FakeVimPlugin::test_vim_insert() KEYS("<c-v>2jh" "2I" "XYZ<esc>", "abc" N "d" X "XYZXYZef" N "" N "jXYZXYZkl" N "mno"); INTEGRITY(false); + // insert in visual mode + data.setText(" a" X "bcde" N " fghij" N " klmno"); + KEYS("v2l" "2Ixyz<esc>", "xyzxy" X "z abcde" N " fghij" N " klmno"); + KEYS("u", X " abcde" N " fghij" N " klmno"); + KEYS("<c-r>", X "xyzxyz abcde" N " fghij" N " klmno"); + KEYS("$.", "xyzxyz abcdxyzxy" X "ze" N " fghij" N " klmno"); + + // repeat only last insertion + data.setText(" abc" N " def" N " ghi"); + KEYS("2l" "2i" "XYZ" "<C-O>j" "123<esc>", " XYZabc" N " def12" X "3" N " ghi"); + KEYS("0l.", " XYZabc" N " 12" X "3 def123" N " ghi"); + // insert nothing + KEYS("i<esc>", " XYZabc" N " 1" X "23 def123" N " ghi"); + KEYS(".", " XYZabc" N " " X "123 def123" N " ghi"); + // repeat insert with special characters data.setText("ab" X "c" N "def"); KEYS("2i<lt>down><esc>", "ab<down><down" X ">c" N "def"); |