fakevim: Correct undo/redo position for changing numbers

Restore position on undo and redo after <C-A> and <C-X> commands.

Do not set dot command if no number was found.

Change-Id: Ia4e6d53ecfbd7f56e874d6a39c0939557f6cdc3d
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Lukas Holecek
2012-11-29 17:11:43 +01:00
committed by hjk
parent fa986939ba
commit 00a10fcfa8
2 changed files with 16 additions and 9 deletions

View File

@@ -571,12 +571,16 @@ void FakeVimPlugin::test_vim_transform_numbers()
KEYS("B9<c-x>", "x-x+x: " X "0 0 0 0 0");
KEYS("B9<c-x>", "x-x+x: -" X "9 0 0 0 0");
data.setText("-- 1 --");
data.setText("-" X "- 1 --");
KEYS("<c-x>", "-- " X "0 --");
KEYS("u", "-" X "- 1 --");
KEYS("<c-r>", "-" X "- 0 --");
KEYS("<c-x><c-x>", "-- -" X "2 --");
KEYS("2<c-a><c-a>", "-- " X "1 --");
KEYS("<c-a>2<c-a>", "-- " X "4 --");
KEYS(".", "-- " X "6 --");
KEYS("u", "-- " X "4 --");
KEYS("<c-r>", "-- " X "6 --");
// hexadecimal and octal numbers
data.setText("0x0 0x1 -1 07 08");