Mercurial > vim
annotate src/testdir/test_undo.vim @ 18993:dcbc559510f6 v8.2.0057
patch 8.2.0057: cannot build with small features
Commit: https://github.com/vim/vim/commit/09d4640f6c4333da5167327629d355062f6629cd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 29 23:53:01 2019 +0100
patch 8.2.0057: cannot build with small features
Problem: Cannot build with small features.
Solution: Add #ifdefs.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 30 Dec 2019 00:00:03 +0100 |
parents | b24648ebcbc9 |
children | 02111977dd05 |
rev | line source |
---|---|
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the undo tree. |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " Since this script is sourced we need to explicitly break changes up in |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " undo-able pieces. Do that by setting 'undolevels'. |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 " Also tests :earlier and :later. |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 func Test_undotree() |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
7 new |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
8 |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
9 normal! Aabc |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 set ul=100 |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
11 let d = undotree() |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
12 call assert_equal(1, d.seq_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
13 call assert_equal(1, d.seq_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
14 call assert_equal(0, d.save_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
15 call assert_equal(0, d.save_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
16 call assert_equal(1, len(d.entries)) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
17 call assert_equal(1, d.entries[0].newhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
18 call assert_equal(1, d.entries[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
19 call assert_true(d.entries[0].time <= d.time_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
20 |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
21 normal! Adef |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 set ul=100 |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
23 let d = undotree() |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
24 call assert_equal(2, d.seq_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
25 call assert_equal(2, d.seq_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
26 call assert_equal(0, d.save_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
27 call assert_equal(0, d.save_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
28 call assert_equal(2, len(d.entries)) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
29 call assert_equal(1, d.entries[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
30 call assert_equal(1, d.entries[1].newhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
31 call assert_equal(2, d.entries[1].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
32 call assert_true(d.entries[1].time <= d.time_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
33 |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 undo |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
35 set ul=100 |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 let d = undotree() |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
37 call assert_equal(2, d.seq_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
38 call assert_equal(1, d.seq_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
39 call assert_equal(0, d.save_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
40 call assert_equal(0, d.save_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
41 call assert_equal(2, len(d.entries)) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
42 call assert_equal(1, d.entries[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
43 call assert_equal(1, d.entries[1].curhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
44 call assert_equal(1, d.entries[1].newhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
45 call assert_equal(2, d.entries[1].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
46 call assert_true(d.entries[1].time == d.time_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
47 |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
48 normal! Aghi |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
49 set ul=100 |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
50 let d = undotree() |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
51 call assert_equal(3, d.seq_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
52 call assert_equal(3, d.seq_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
53 call assert_equal(0, d.save_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
54 call assert_equal(0, d.save_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
55 call assert_equal(2, len(d.entries)) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
56 call assert_equal(1, d.entries[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
57 call assert_equal(2, d.entries[1].alt[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
58 call assert_equal(1, d.entries[1].newhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
59 call assert_equal(3, d.entries[1].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
60 call assert_true(d.entries[1].time <= d.time_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
61 |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
62 undo |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
63 set ul=100 |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
64 let d = undotree() |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
65 call assert_equal(3, d.seq_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
66 call assert_equal(1, d.seq_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
67 call assert_equal(0, d.save_last) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
68 call assert_equal(0, d.save_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
69 call assert_equal(2, len(d.entries)) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
70 call assert_equal(1, d.entries[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
71 call assert_equal(2, d.entries[1].alt[0].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
72 call assert_equal(1, d.entries[1].curhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
73 call assert_equal(1, d.entries[1].newhead) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
74 call assert_equal(3, d.entries[1].seq) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
75 call assert_true(d.entries[1].time == d.time_cur) |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 w! Xtest |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
78 let d = undotree() |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
79 call assert_equal(1, d.save_cur) |
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
80 call assert_equal(1, d.save_last) |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 call delete('Xtest') |
12827
ff494a964ab7
patch 8.0.1290: seq_cur of undotree() wrong after undo
Christian Brabandt <cb@256bit.org>
parents:
12779
diff
changeset
|
82 bwipe! Xtest |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 func FillBuffer() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 for i in range(1,13) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 put=i |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
88 " Set 'undolevels' to split undo. |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 exe "setg ul=" . &g:ul |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 endfor |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 func Test_global_local_undolevels() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 new one |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 set undolevels=5 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 call FillBuffer() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 " will only undo the last 5 changes, end up with 13 - (5 + 1) = 7 lines |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 earlier 10 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 call assert_equal(5, &g:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 call assert_equal(-123456, &l:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call assert_equal('7', getline('$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 new two |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 setlocal undolevels=2 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 call FillBuffer() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 " will only undo the last 2 changes, end up with 13 - (2 + 1) = 10 lines |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 earlier 10 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 call assert_equal(5, &g:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal(2, &l:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 call assert_equal('10', getline('$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 setlocal ul=10 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 call assert_equal(5, &g:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 call assert_equal(10, &l:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 " Setting local value in "two" must not change local value in "one" |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 wincmd p |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 call assert_equal(5, &g:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 call assert_equal(-123456, &l:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 new three |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 setglobal ul=50 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 call assert_equal(50, &g:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 call assert_equal(-123456, &l:undolevels) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 " Drop created windows |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 set ul& |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 new |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 only! |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 func BackOne(expected) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 call feedkeys('g-', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 call assert_equal(a:expected, getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 func Test_undo_del_chars() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 " Setup a buffer without creating undo entries |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 new |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 set ul=-1 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 call setline(1, ['123-456']) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 set ul=100 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 1 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 call test_settime(100) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 " Delete three characters and undo with g- |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 call feedkeys('x', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 call feedkeys('x', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 call feedkeys('x', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 call assert_equal('-456', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 call BackOne('3-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 call BackOne('23-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 call BackOne('123-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 call assert_fails("BackOne('123-456')") |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 :" Delete three other characters and go back in time with g- |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 call feedkeys('$x', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 call feedkeys('x', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 call feedkeys('x', 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 call assert_equal('123-', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 call test_settime(101) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 call BackOne('123-4') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call BackOne('123-45') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 " skips '123-456' because it's older |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 call BackOne('-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 call BackOne('3-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 call BackOne('23-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 call BackOne('123-456') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 call assert_fails("BackOne('123-456')") |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 normal 10g+ |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 call assert_equal('123-', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 :" Jump two seconds and go some seconds forward and backward |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 call test_settime(103) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 call feedkeys("Aa\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 call feedkeys("Ab\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 call feedkeys("Ac\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 call assert_equal('123-abc', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 earlier 1s |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 call assert_equal('123-', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 earlier 3s |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 call assert_equal('123-456', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 later 1s |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 call assert_equal('123-', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 later 1h |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 call assert_equal('123-abc', getline(1)) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
188 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 close! |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
190 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
191 |
10049
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
192 func Test_undolist() |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
193 new |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
194 set ul=100 |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
195 |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
196 let a = execute('undolist') |
10049
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
197 call assert_equal("\nNothing to undo", a) |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
198 |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
199 " 1 leaf (2 changes). |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
200 call feedkeys('achange1', 'xt') |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
201 call feedkeys('achange2', 'xt') |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
202 let a = execute('undolist') |
10049
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
203 call assert_match("^\nnumber changes when *saved\n *2 *2 .*$", a) |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
204 |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
205 " 2 leaves. |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
206 call feedkeys('u', 'xt') |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
207 call feedkeys('achange3\<Esc>', 'xt') |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
208 let a = execute('undolist') |
10049
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
209 call assert_match("^\nnumber changes when *saved\n *2 *2 *.*\n *3 *2 .*$", a) |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
210 close! |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
211 endfunc |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
212 |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
213 func Test_U_command() |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
214 new |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
215 set ul=100 |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
216 call feedkeys("achange1\<Esc>", 'xt') |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
217 call feedkeys("achange2\<Esc>", 'xt') |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
218 norm! U |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
219 call assert_equal('', getline(1)) |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
220 norm! U |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
221 call assert_equal('change1change2', getline(1)) |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
222 close! |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
223 endfunc |
efc8a434f38f
commit https://github.com/vim/vim/commit/c628fdcd46e93c308f742efdf54248695960e290
Christian Brabandt <cb@256bit.org>
parents:
9674
diff
changeset
|
224 |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
225 func Test_undojoin() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
226 new |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
227 call feedkeys("Goaaaa\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
228 call feedkeys("obbbb\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
229 call assert_equal(['aaaa', 'bbbb'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
230 call feedkeys("u", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
231 call assert_equal(['aaaa'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
232 call feedkeys("obbbb\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
233 undojoin |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
234 " Note: next change must not be as if typed |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
235 call feedkeys("occcc\<Esc>", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
236 call assert_equal(['aaaa', 'bbbb', 'cccc'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
237 call feedkeys("u", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
238 call assert_equal(['aaaa'], getline(2, '$')) |
10631
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
239 bwipe! |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
240 endfunc |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
241 |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
242 func Test_undojoin_redo() |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
243 new |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
244 call setline(1, ['first line', 'second line']) |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
245 call feedkeys("ixx\<Esc>", 'xt') |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
246 call feedkeys(":undojoin | redo\<CR>", 'xt') |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
247 call assert_equal('xxfirst line', getline(1)) |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
248 call assert_equal('second line', getline(2)) |
cbf17371627c
patch 8.0.0205: wrong behavior after :undojoin
Christian Brabandt <cb@256bit.org>
parents:
10518
diff
changeset
|
249 bwipe! |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
250 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
251 |
18902
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
252 " undojoin not allowed after undo |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
253 func Test_undojoin_after_undo() |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
254 new |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
255 call feedkeys("ixx\<Esc>u", 'xt') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
256 call assert_fails(':undojoin', 'E790:') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
257 bwipe! |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
258 endfunc |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
259 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
260 " undojoin is a noop when no change yet, or when 'undolevels' is negative |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
261 func Test_undojoin_noop() |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
262 new |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
263 call feedkeys(":undojoin\<CR>", 'xt') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
264 call assert_equal([''], getline(1, '$')) |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
265 setlocal undolevels=-1 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
266 call feedkeys("ixx\<Esc>u", 'xt') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
267 call feedkeys(":undojoin\<CR>", 'xt') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
268 call assert_equal(['xx'], getline(1, '$')) |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
269 bwipe! |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
270 endfunc |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
271 |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
272 func Test_undo_write() |
12779
73eb8a2d7f04
patch 8.0.1267: Test_swap_group may leave file behind
Christian Brabandt <cb@256bit.org>
parents:
12686
diff
changeset
|
273 call delete('Xtest') |
9674
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
274 split Xtest |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
275 call feedkeys("ione one one\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
276 w! |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
277 call feedkeys("otwo\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 call feedkeys("otwo\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
279 w |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
280 call feedkeys("othree\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
281 call assert_equal(['one one one', 'two', 'two', 'three'], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
282 earlier 1f |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
283 call assert_equal(['one one one', 'two', 'two'], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
284 earlier 1f |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
285 call assert_equal(['one one one'], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
286 earlier 1f |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
287 call assert_equal([''], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
288 later 1f |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
289 call assert_equal(['one one one'], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
290 later 1f |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
291 call assert_equal(['one one one', 'two', 'two'], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
292 later 1f |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
293 call assert_equal(['one one one', 'two', 'two', 'three'], getline(1, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
294 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
295 close! |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
296 call delete('Xtest') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
297 bwipe! Xtest |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
298 endfunc |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
299 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
300 func Test_insert_expr() |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
301 new |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
302 " calling setline() triggers undo sync |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
303 call feedkeys("oa\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
304 call feedkeys("ob\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
305 set ul=100 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
306 call feedkeys("o1\<Esc>a2\<C-R>=setline('.','1234')\<CR>\<CR>\<Esc>", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
307 call assert_equal(['a', 'b', '120', '34'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
308 call feedkeys("u", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
309 call assert_equal(['a', 'b', '12'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
310 call feedkeys("u", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
311 call assert_equal(['a', 'b'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
312 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
313 call feedkeys("oc\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
314 set ul=100 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
315 call feedkeys("o1\<Esc>a2\<C-R>=setline('.','1234')\<CR>\<CR>\<Esc>", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
316 call assert_equal(['a', 'b', 'c', '120', '34'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
317 call feedkeys("u", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
318 call assert_equal(['a', 'b', 'c', '12'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
319 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
320 call feedkeys("od\<Esc>", 'xt') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
321 set ul=100 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
322 call feedkeys("o1\<Esc>a2\<C-R>=string(123)\<CR>\<Esc>", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
323 call assert_equal(['a', 'b', 'c', '12', 'd', '12123'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
324 call feedkeys("u", 'x') |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
325 call assert_equal(['a', 'b', 'c', '12', 'd'], getline(2, '$')) |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
326 |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
327 close! |
adc7212951ee
commit https://github.com/vim/vim/commit/170b10b421f0c9fda08b7cfd3bb043c064f3659a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
328 endfunc |
10518
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
329 |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
330 func Test_undofile_earlier() |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
331 " Issue #1254 |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
332 " create undofile with timestamps older than Vim startup time. |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
333 let t0 = localtime() - 43200 |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
334 call test_settime(t0) |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
335 new Xfile |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
336 call feedkeys("ione\<Esc>", 'xt') |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
337 set ul=100 |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
338 call test_settime(t0 + 1) |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
339 call feedkeys("otwo\<Esc>", 'xt') |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
340 set ul=100 |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
341 call test_settime(t0 + 2) |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
342 call feedkeys("othree\<Esc>", 'xt') |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
343 set ul=100 |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
344 w |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
345 wundo Xundofile |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
346 bwipe! |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
347 " restore normal timestamps. |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
348 call test_settime(0) |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
349 new Xfile |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
350 rundo Xundofile |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
351 earlier 1d |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
352 call assert_equal('', getline(1)) |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
353 bwipe! |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
354 call delete('Xfile') |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
355 call delete('Xundofile') |
de77fa909414
commit https://github.com/vim/vim/commit/cbd4de44e8d08fba3c09eb40ad6e36e83faf020a
Christian Brabandt <cb@256bit.org>
parents:
10049
diff
changeset
|
356 endfunc |
12686
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
357 |
18902
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
358 func Test_wundo_errors() |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
359 new |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
360 call setline(1, 'hello') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
361 call assert_fails('wundo! Xdoesnotexist/Xundofile', 'E828:') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
362 bwipe! |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
363 endfunc |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
364 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
365 " Check that reading a truncated undo file doesn't hang. |
17630
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
366 func Test_undofile_truncated() |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
367 new |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
368 call setline(1, 'hello') |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
369 set ul=100 |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
370 wundo Xundofile |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
371 let contents = readfile('Xundofile', 'B') |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
372 |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
373 " try several sizes |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
374 for size in range(20, 500, 33) |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
375 call writefile(contents[0:size], 'Xundofile') |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
376 call assert_fails('rundo Xundofile', 'E825:') |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
377 endfor |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
378 |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
379 bwipe! |
18058
187742518187
patch 8.1.2024: delete call commented out for debugging
Bram Moolenaar <Bram@vim.org>
parents:
18035
diff
changeset
|
380 call delete('Xundofile') |
17630
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
381 endfunc |
380adf86bf66
patch 8.1.1812: reading a truncted undo file hangs Vim
Bram Moolenaar <Bram@vim.org>
parents:
16702
diff
changeset
|
382 |
18902
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
383 func Test_rundo_errors() |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
384 call assert_fails('rundo XfileDoesNotExist', 'E822:') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
385 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
386 call writefile(['abc'], 'Xundofile') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
387 call assert_fails('rundo Xundofile', 'E823:') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
388 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
389 call delete('Xundofile') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
390 endfunc |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
391 |
12686
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
392 " Test for undo working properly when executing commands from a register. |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
393 " Also test this in an empty buffer. |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
394 func Test_cmd_in_reg_undo() |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
395 enew! |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
396 let @a = "Ox\<Esc>jAy\<Esc>kdd" |
12686
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
397 edit +/^$ test_undo.vim |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
398 normal @au |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
399 call assert_equal(0, &modified) |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
400 return |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
401 new |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
402 normal @au |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
403 call assert_equal(0, &modified) |
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
404 only! |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
405 let @a = '' |
12686
aa658b33f25a
patch 8.0.1221: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
406 endfunc |
13117
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
407 |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
408 " This used to cause an illegal memory access |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
409 func Test_undo_append() |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
410 new |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
411 call feedkeys("axx\<Esc>v", 'xt') |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
412 undo |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
413 norm o |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
414 quit |
cfaa513efa3f
patch 8.0.1433: illegal memory access after undo
Christian Brabandt <cb@256bit.org>
parents:
12827
diff
changeset
|
415 endfunc |
13134
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
416 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
417 func Test_undo_0() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
418 new |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
419 set ul=100 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
420 normal i1 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
421 undo |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
422 normal i2 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
423 undo |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
424 normal i3 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
425 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
426 undo 0 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
427 let d = undotree() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
428 call assert_equal('', getline(1)) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
429 call assert_equal(0, d.seq_cur) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
430 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
431 redo |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
432 let d = undotree() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
433 call assert_equal('3', getline(1)) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
434 call assert_equal(3, d.seq_cur) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
435 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
436 undo 2 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
437 undo 0 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
438 let d = undotree() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
439 call assert_equal('', getline(1)) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
440 call assert_equal(0, d.seq_cur) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
441 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
442 redo |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
443 let d = undotree() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
444 call assert_equal('2', getline(1)) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
445 call assert_equal(2, d.seq_cur) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
446 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
447 undo 1 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
448 undo 0 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
449 let d = undotree() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
450 call assert_equal('', getline(1)) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
451 call assert_equal(0, d.seq_cur) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
452 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
453 redo |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
454 let d = undotree() |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
455 call assert_equal('1', getline(1)) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
456 call assert_equal(1, d.seq_cur) |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
457 |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
458 bwipe! |
c4b5ad2b3596
patch 8.0.1441: using ":undo 0" leaves undo in wrong state
Christian Brabandt <cb@256bit.org>
parents:
13117
diff
changeset
|
459 endfunc |
13202
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
460 |
18902
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
461 " undo or redo are noop if there is nothing to undo or redo |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
462 func Test_undo_redo_noop() |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
463 new |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
464 call assert_fails('undo 2', 'E830:') |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
465 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
466 message clear |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
467 undo |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
468 let messages = split(execute('message'), "\n") |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
469 call assert_equal('Already at oldest change', messages[-1]) |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
470 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
471 message clear |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
472 redo |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
473 let messages = split(execute('message'), "\n") |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
474 call assert_equal('Already at newest change', messages[-1]) |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
475 |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
476 bwipe! |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
477 endfunc |
b24648ebcbc9
patch 8.2.0012: some undo functionality is not tested
Bram Moolenaar <Bram@vim.org>
parents:
18894
diff
changeset
|
478 |
13202
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
479 func Test_redo_empty_line() |
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
480 new |
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
481 exe "norm\x16r\x160" |
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
482 exe "norm." |
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
483 bwipe! |
2941a86f8aaa
patch 8.0.1475: invalid memory access in read_redo()
Christian Brabandt <cb@256bit.org>
parents:
13134
diff
changeset
|
484 endfunc |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
485 |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
486 funct Test_undofile() |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
487 " Test undofile() without setting 'undodir'. |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
488 if has('persistent_undo') |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
489 call assert_equal(fnamemodify('.Xundofoo.un~', ':p'), undofile('Xundofoo')) |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
490 else |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
491 call assert_equal('', undofile('Xundofoo')) |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
492 endif |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
493 call assert_equal('', undofile('')) |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
494 |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
495 " Test undofile() with 'undodir' set to to an existing directory. |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
496 call mkdir('Xundodir') |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
497 set undodir=Xundodir |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
498 let cwd = getcwd() |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
499 if has('win32') |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
500 " Replace windows drive such as C:... into C%... |
15150
83a366325158
patch 8.1.0585: undo test may fail on MS-Windows
Bram Moolenaar <Bram@vim.org>
parents:
14015
diff
changeset
|
501 let cwd = substitute(cwd, '^\([a-zA-Z]\):', '\1%', 'g') |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
502 endif |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
503 let cwd = substitute(cwd . '/Xundofoo', '/', '%', 'g') |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
504 if has('persistent_undo') |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
505 call assert_equal('Xundodir/' . cwd, undofile('Xundofoo')) |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
506 else |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
507 call assert_equal('', undofile('Xundofoo')) |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
508 endif |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
509 call assert_equal('', undofile('')) |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
510 call delete('Xundodir', 'd') |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
511 |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
512 " Test undofile() with 'undodir' set to a non-existing directory. |
18035
11dca9732a48
patch 8.1.2013: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17630
diff
changeset
|
513 call assert_equal('', 'Xundofoo'->undofile()) |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
514 |
18473
0eeaa9a6e4e7
patch 8.1.2230: MS-Windows: testing external commands can be improved
Bram Moolenaar <Bram@vim.org>
parents:
18058
diff
changeset
|
515 if !has('win32') && isdirectory('/tmp') |
16700
46322a4e6028
patch 8.1.1352: undofile() reports wrong name
Bram Moolenaar <Bram@vim.org>
parents:
15150
diff
changeset
|
516 set undodir=/tmp |
16702
16a698aeeec1
patch 8.1.1353: undo test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
16700
diff
changeset
|
517 if has('osx') |
16a698aeeec1
patch 8.1.1353: undo test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
16700
diff
changeset
|
518 call assert_equal('/tmp/%private%tmp%file', undofile('///tmp/file')) |
16a698aeeec1
patch 8.1.1353: undo test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
16700
diff
changeset
|
519 else |
16a698aeeec1
patch 8.1.1353: undo test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
16700
diff
changeset
|
520 call assert_equal('/tmp/%tmp%file', undofile('///tmp/file')) |
16a698aeeec1
patch 8.1.1353: undo test fails on Mac
Bram Moolenaar <Bram@vim.org>
parents:
16700
diff
changeset
|
521 endif |
16700
46322a4e6028
patch 8.1.1352: undofile() reports wrong name
Bram Moolenaar <Bram@vim.org>
parents:
15150
diff
changeset
|
522 endif |
46322a4e6028
patch 8.1.1352: undofile() reports wrong name
Bram Moolenaar <Bram@vim.org>
parents:
15150
diff
changeset
|
523 |
14015
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
524 set undodir& |
9709d783261f
patch 8.1.0025: no test for the undofile() function
Christian Brabandt <cb@256bit.org>
parents:
13202
diff
changeset
|
525 endfunc |
18894
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
526 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
527 " Tests for the undo file |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
528 " Explicitly break changes up in undo-able pieces by setting 'undolevels'. |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
529 func Test_undofile_2() |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
530 set undolevels=100 undofile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
531 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
532 call append(0, 'this is one line') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
533 call cursor(1, 1) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
534 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
535 " first a simple one-line change. |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
536 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
537 s/one/ONE/ |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
538 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
539 write |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
540 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
541 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
542 undo |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
543 call assert_equal('this is one line', getline(1)) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
544 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
545 " change in original file fails check |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
546 set noundofile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
547 edit! Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
548 s/line/Line/ |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
549 write |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
550 set undofile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
551 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
552 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
553 undo |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
554 call assert_equal('this is ONE Line', getline(1)) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
555 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
556 " add 10 lines, delete 6 lines, undo 3 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
557 set undofile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
558 call setbufline(0, 1, ['one', 'two', 'three', 'four', 'five', 'six', |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
559 \ 'seven', 'eight', 'nine', 'ten']) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
560 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
561 normal 3Gdd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
562 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
563 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
564 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
565 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
566 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
567 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
568 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
569 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
570 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
571 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
572 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
573 write |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
574 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
575 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
576 normal uuu |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
577 call assert_equal(['one', 'two', 'six', 'seven', 'eight', 'nine', 'ten'], |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
578 \ getline(1, '$')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
579 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
580 " Test that reading the undofiles when setting undofile works |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
581 set noundofile undolevels=0 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
582 exe "normal i\n" |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
583 undo |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
584 edit! Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
585 set undofile undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
586 normal uuuuuu |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
587 call assert_equal(['one', 'two', 'three', 'four', 'five', 'six', 'seven', |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
588 \ 'eight', 'nine', 'ten'], getline(1, '$')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
589 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
590 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
591 call delete('Xtestfile') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
592 let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
593 call delete(ufile) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
594 set undofile& undolevels& |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
595 endfunc |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
596 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
597 " Test 'undofile' using a file encrypted with 'zip' crypt method |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
598 func Test_undofile_cryptmethod_zip() |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
599 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
600 set undofile cryptmethod=zip |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
601 call append(0, ['monday', 'tuesday', 'wednesday', 'thursday', 'friday']) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
602 call cursor(5, 1) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
603 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
604 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
605 normal kkkdd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
606 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
607 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
608 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
609 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
610 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
611 " encrypt the file using key 'foobar' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
612 call feedkeys("foobar\nfoobar\n") |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
613 X |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
614 write! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
615 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
616 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
617 call feedkeys("foobar\n") |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
618 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
619 set key= |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
620 normal uu |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
621 call assert_equal(['monday', 'wednesday', 'thursday', 'friday', ''], |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
622 \ getline(1, '$')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
623 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
624 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
625 call delete('Xtestfile') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
626 let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
627 call delete(ufile) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
628 set undofile& undolevels& cryptmethod& |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
629 endfunc |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
630 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
631 " Test 'undofile' using a file encrypted with 'blowfish' crypt method |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
632 func Test_undofile_cryptmethod_blowfish() |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
633 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
634 set undofile cryptmethod=blowfish |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
635 call append(0, ['jan', 'feb', 'mar', 'apr', 'jun']) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
636 call cursor(5, 1) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
637 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
638 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
639 exe 'normal kk0ifoo ' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
640 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
641 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
642 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
643 exe 'normal ibar ' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
644 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
645 " encrypt the file using key 'foobar' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
646 call feedkeys("foobar\nfoobar\n") |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
647 X |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
648 write! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
649 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
650 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
651 call feedkeys("foobar\n") |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
652 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
653 set key= |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
654 call search('bar') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
655 call assert_equal('bar apr', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
656 undo |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
657 call assert_equal('apr', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
658 undo |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
659 call assert_equal('foo mar', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
660 undo |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
661 call assert_equal('mar', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
662 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
663 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
664 call delete('Xtestfile') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
665 let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
666 call delete(ufile) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
667 set undofile& undolevels& cryptmethod& |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
668 endfunc |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
669 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
670 " Test 'undofile' using a file encrypted with 'blowfish2' crypt method |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
671 func Test_undofile_cryptmethod_blowfish2() |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
672 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
673 set undofile cryptmethod=blowfish2 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
674 call append(0, ['jan', 'feb', 'mar', 'apr', 'jun']) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
675 call cursor(5, 1) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
676 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
677 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
678 exe 'normal kk0ifoo ' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
679 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
680 normal dd |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
681 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
682 exe 'normal ibar ' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
683 set undolevels=100 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
684 " encrypt the file using key 'foo2bar' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
685 call feedkeys("foo2bar\nfoo2bar\n") |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
686 X |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
687 write! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
688 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
689 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
690 call feedkeys("foo2bar\n") |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
691 edit Xtestfile |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
692 set key= |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
693 call search('bar') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
694 call assert_equal('bar apr', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
695 normal u |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
696 call assert_equal('apr', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
697 normal u |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
698 call assert_equal('foo mar', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
699 normal u |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
700 call assert_equal('mar', getline('.')) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
701 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
702 bwipe! |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
703 call delete('Xtestfile') |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
704 let ufile = has('vms') ? '_un_Xtestfile' : '.Xtestfile.un~' |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
705 call delete(ufile) |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
706 set undofile& undolevels& cryptmethod& |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
707 endfunc |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
708 |
aad0d64cc133
patch 8.2.0008: test72 is old style
Bram Moolenaar <Bram@vim.org>
parents:
18473
diff
changeset
|
709 " vim: shiftwidth=2 sts=2 expandtab |