Bram Moolenaar | 9d47f17 | 2006-03-15 23:03:01 +0000 | [diff] [blame] | 1 | Tests for undo tree. |
| 2 | Since this script is sourced we need to explicitly break changes up in |
| 3 | undo-able pieces. Do that by setting 'undolevels'. |
| 4 | |
| 5 | STARTTEST |
| 6 | :" Delete three characters and undo |
| 7 | Gx:set ul=100 |
| 8 | x:set ul=100 |
| 9 | x:.w! test.out |
| 10 | g-:.w >>test.out |
| 11 | g-:.w >>test.out |
| 12 | g-:.w >>test.out |
| 13 | g-:.w >>test.out |
| 14 | :" |
| 15 | :/^111/w >>test.out |
| 16 | :" Delete three other characters and go back in time step by step |
| 17 | $x:set ul=100 |
| 18 | x:set ul=100 |
| 19 | x:.w >>test.out |
| 20 | :sleep 1 |
| 21 | g-:.w >>test.out |
| 22 | g-:.w >>test.out |
| 23 | g-:.w >>test.out |
| 24 | g-:.w >>test.out |
| 25 | g-:.w >>test.out |
| 26 | g-:.w >>test.out |
| 27 | g-:.w >>test.out |
| 28 | g-:.w >>test.out |
| 29 | 10g+:.w >>test.out |
| 30 | :" |
| 31 | :/^222/w >>test.out |
| 32 | :" Delay for three seconds and go some seconds forward and backward |
Bram Moolenaar | fa1d140 | 2006-03-25 21:59:56 +0000 | [diff] [blame] | 33 | :sleep 2 |
Bram Moolenaar | 9d47f17 | 2006-03-15 23:03:01 +0000 | [diff] [blame] | 34 | Aa:set ul=100 |
| 35 | Ab:set ul=100 |
| 36 | Ac:set ul=100 |
| 37 | :.w >>test.out |
| 38 | :ear 1s |
| 39 | :.w >>test.out |
| 40 | :ear 3s |
| 41 | :.w >>test.out |
| 42 | :later 1s |
| 43 | :.w >>test.out |
| 44 | :later 1h |
| 45 | :.w >>test.out |
Bram Moolenaar | eb3593b | 2006-04-22 22:33:57 +0000 | [diff] [blame^] | 46 | :" |
| 47 | :" test undojoin |
| 48 | Goaaaa:set ul=100 |
| 49 | obbbbu:.w >>test.out |
| 50 | obbbb:set ul=100 |
| 51 | :undojoin |
| 52 | occccu:.w >>test.out |
Bram Moolenaar | 9d47f17 | 2006-03-15 23:03:01 +0000 | [diff] [blame] | 53 | :qa! |
| 54 | ENDTEST |
| 55 | |
| 56 | 1111 ----- |
| 57 | 2222 ----- |
| 58 | |
| 59 | 123456789 |