Bram Moolenaar | 19a1669 | 2016-09-01 22:19:47 +0200 | [diff] [blame] | 1 | |
| 2 | " Test that a deleted mark is restored after delete-undo-redo-undo. |
| 3 | function! Test_Restore_DelMark() |
| 4 | enew! |
| 5 | call append(0, [" textline A", " textline B", " textline C"]) |
| 6 | normal! 2gg |
| 7 | set nocp viminfo+=nviminfo |
| 8 | exe "normal! i\<C-G>u\<Esc>" |
| 9 | exe "normal! maddu\<C-R>u" |
| 10 | let pos = getpos("'a") |
| 11 | call assert_equal(2, pos[1]) |
| 12 | call assert_equal(1, pos[2]) |
| 13 | enew! |
| 14 | endfunction |
| 15 | |
| 16 | " Test that CTRL-A and CTRL-X updates last changed mark '[, ']. |
| 17 | function! Test_Incr_Marks() |
| 18 | enew! |
| 19 | call append(0, ["123 123 123", "123 123 123", "123 123 123"]) |
| 20 | normal! gg |
| 21 | execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX" |
| 22 | call assert_equal("AAA 123 123", getline(1)) |
| 23 | call assert_equal("123 XXXXXXX", getline(2)) |
| 24 | call assert_equal("XXX 123 123", getline(3)) |
| 25 | enew! |
| 26 | endfunction |