Mercurial > vim
annotate src/testdir/test_textformat.vim @ 28037:12a256140887 v8.2.4543
patch 8.2.4543: Coverity warning for refactored tag search code
Commit: https://github.com/vim/vim/commit/20fb28b1dcc092787e1a7b22dcfcfe1e46e29813
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Fri Mar 11 12:05:18 2022 +0000
patch 8.2.4543: Coverity warning for refactored tag search code
Problem: Coverity warning for refactored tag search code.
Solution: Avoid the warnings. Update comments. Add one more test case.
(Yegappan Lakshmanan, closes #9928)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 11 Mar 2022 13:15:04 +0100 |
parents | 044a12908236 |
children | ef62a0ea2a78 |
rev | line source |
---|---|
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for the various 'formatoptions' settings |
18408
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
2 |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
3 source check.vim |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
4 |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func Test_text_format() |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 enew! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 setl noai tw=2 fo=t |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 \ ' ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 exe "normal /^{/+1\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 normal gRa b |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 \ 'a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 \ 'b'], getline(lnum - 1, lnum)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 setl ai tw=2 fo=tw |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 \ 'a b ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 \ 'a ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 exe "normal /^{/+1\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 normal gqgqjjllab |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 \ 'a ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 \ 'b ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 \ 'a ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 \ 'b'], getline(lnum - 4, lnum)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 setl tw=3 fo=t |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 \ "a \<C-A>", |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 exe "normal /^{/+1\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 exe "normal gqgqo\na \<C-V>\<C-A>" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 \ 'a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 \ "\<C-A>", |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 \ 'a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 \ "\<C-A>"], getline(lnum - 4, lnum)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 setl tw=2 fo=tcq1 comments=:# |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 \ 'a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 \ '#a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 exe "normal /^{/+1\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 exe "normal gqgqjgqgqo\na b\n#a b" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 \ 'a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 \ '#a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 \ 'a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 \ '#a b'], getline(lnum - 4, lnum)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 setl tw=5 fo=tcn comments=:# |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 \ ' 1 a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 \ '# 1 a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 exe "normal /^{/+1\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 exe "normal A b\<Esc>jA b" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 \ ' 1 a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 \ ' b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 \ '# 1 a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 \ '# b'], getline(lnum - 3, lnum)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 setl tw=5 fo=t2a si |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 \ ' x a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 \ ' b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 \ ' c', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 exe "normal /^{/+3\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 exe "normal i \<Esc>A_" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 \ '', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 \ ' x a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 \ ' b_', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 \ ' c', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 \ ''], getline(lnum - 2, lnum + 2)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 setl tw=5 fo=qn comments=:# |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 \ '# 1 a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 exe "normal /^{/+1\n5|" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 normal gwap |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 call assert_equal(5, col('.')) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 \ '# 1 a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 \ '# b'], getline(lnum, lnum + 1)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 setl tw=5 fo=q2 comments=:# |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 \ '# x', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 \ '# a b', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 exe "normal /^{/+1\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 normal gwap |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 \ '# x a', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 \ '# b'], getline(lnum, lnum + 1)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 setl tw& fo=a |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 \ '{', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 \ ' 1aa', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 \ ' 2bb', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 \ '}']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 exe "normal /^{/+2\n0" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 normal I^^ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 call assert_equal('{ 1aa ^^2bb }', getline('.')) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 setl tw=20 fo=an12wcq comments=s1:/*,mb:*,ex:*/ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 call append('$', [ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 \ '/* abc def ghi jkl ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 \ ' * mno pqr stu', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 \ ' */']) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 exe "normal /mno pqr/\n" |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 normal A vwx yz |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 let lnum = line('.') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 \ ' * mno pqr stu ', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 \ ' * vwx yz', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 \ ' */'], getline(lnum - 1, lnum + 1)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 normal ggdG |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 setl tw=12 fo=tqnc comments=:# |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 call setline('.', '# 1 xxxxx') |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 normal A foobar |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 call assert_equal([ |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 \ '# 1 xxxxx', |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 \ '# foobar'], getline(1, 2)) |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 |
15440
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
169 " Test the 'p' flag for 'formatoptions' |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
170 " First test without the flag: that it will break "Mr. Feynman" at the space |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
171 normal ggdG |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
172 setl tw=28 fo=tcq |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
173 call setline('.', 'Surely you''re joking, Mr. Feynman!') |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
174 normal gqq |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
175 call assert_equal([ |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
176 \ 'Surely you''re joking, Mr.', |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
177 \ 'Feynman!'], getline(1, 2)) |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
178 " Now test with the flag: that it will push the name with the title onto the |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
179 " next line |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
180 normal ggdG |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
181 setl fo+=p |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
182 call setline('.', 'Surely you''re joking, Mr. Feynman!') |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
183 normal gqq |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
184 call assert_equal([ |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
185 \ 'Surely you''re joking,', |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
186 \ 'Mr. Feynman!'], getline(1, 2)) |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
187 " Ensure that it will still break if two spaces are entered |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
188 normal ggdG |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
189 call setline('.', 'Surely you''re joking, Mr. Feynman!') |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
190 normal gqq |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
191 call assert_equal([ |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
192 \ 'Surely you''re joking, Mr.', |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
193 \ 'Feynman!'], getline(1, 2)) |
5ecac7734184
patch 8.1.0728: cannot avoid breaking after a single space.
Bram Moolenaar <Bram@vim.org>
parents:
15326
diff
changeset
|
194 |
12851
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
195 setl ai& tw& fo& si& comments& |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
196 enew! |
90aaa974594e
patch 8.0.1302: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
197 endfunc |
13146
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
198 |
26516
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
199 func Test_format_c_comment() |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
200 new |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
201 setl ai cindent tw=40 et fo=croql |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
202 let text =<< trim END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
203 var = 2345; // asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
204 END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
205 call setline(1, text) |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
206 normal gql |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
207 let expected =<< trim END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
208 var = 2345; // asdf asdf asdf asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
209 // asdf asdf asdf asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
210 END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
211 call assert_equal(expected, getline(1, '$')) |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
212 |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
213 %del |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
214 let text =<< trim END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
215 var = 2345; // asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
216 END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
217 call setline(1, text) |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
218 normal gql |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
219 let expected =<< trim END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
220 var = 2345; // asdf asdf asdf asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
221 // asdf asdf asdf asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
222 // asdf asdf |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
223 END |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
224 call assert_equal(expected, getline(1, '$')) |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
225 |
26807
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
226 %del |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
227 let text =<< trim END |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
228 #if 0 // This is another long end of |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
229 // line comment that |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
230 // wraps. |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
231 END |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
232 call setline(1, text) |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
233 normal gq2j |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
234 let expected =<< trim END |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
235 #if 0 // This is another long |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
236 // end of line comment |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
237 // that wraps. |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
238 END |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
239 call assert_equal(expected, getline(1, '$')) |
c1e083481f5d
patch 8.2.3932: C line comment not formatted properly
Bram Moolenaar <Bram@vim.org>
parents:
26516
diff
changeset
|
240 |
27599
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
241 " Using either "o" or "O" repeats a line comment occupying a whole line. |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
242 %del |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
243 let text =<< trim END |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
244 nop; |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
245 // This is a comment |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
246 val = val; |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
247 END |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
248 call setline(1, text) |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
249 normal 2Go |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
250 let expected =<< trim END |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
251 nop; |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
252 // This is a comment |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
253 // |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
254 val = val; |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
255 END |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
256 call assert_equal(expected, getline(1, '$')) |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
257 normal 2GO |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
258 let expected =<< trim END |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
259 nop; |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
260 // |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
261 // This is a comment |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
262 // |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
263 val = val; |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
264 END |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
265 call assert_equal(expected, getline(1, '$')) |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
266 |
044a12908236
patch 8.2.4326: "o" and "O" copying comment not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
26819
diff
changeset
|
267 " Using "o" repeats a line comment after a statement, "O" does not. |
26811
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
268 %del |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
269 let text =<< trim END |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
270 nop; |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
271 val = val; // This is a comment |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
272 END |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
273 call setline(1, text) |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
274 normal 2Go |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
275 let expected =<< trim END |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
276 nop; |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
277 val = val; // This is a comment |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
278 // |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
279 END |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
280 call assert_equal(expected, getline(1, '$')) |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
281 normal 2GO |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
282 let expected =<< trim END |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
283 nop; |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
284 |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
285 val = val; // This is a comment |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
286 // |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
287 END |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
288 call assert_equal(expected, getline(1, '$')) |
f0fdd992cfb9
patch 8.2.3934: repeating line comment is undesired for "O" command
Bram Moolenaar <Bram@vim.org>
parents:
26807
diff
changeset
|
289 |
26819
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
290 " Using "o" does not repeat a comment in a string |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
291 %del |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
292 let text =<< trim END |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
293 nop; |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
294 val = " // This is not a comment"; |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
295 END |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
296 call setline(1, text) |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
297 normal 2Gox |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
298 let expected =<< trim END |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
299 nop; |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
300 val = " // This is not a comment"; |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
301 x |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
302 END |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
303 call assert_equal(expected, getline(1, '$')) |
0d798c7e1865
patch 8.2.3938: line comment start is also found in a string
Bram Moolenaar <Bram@vim.org>
parents:
26813
diff
changeset
|
304 |
26813
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
305 " Using CTRL-U after "o" fixes the indent |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
306 %del |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
307 let text =<< trim END |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
308 { |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
309 val = val; // This is a comment |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
310 END |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
311 call setline(1, text) |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
312 exe "normal! 2Go\<C-U>x\<Esc>" |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
313 let expected =<< trim END |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
314 { |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
315 val = val; // This is a comment |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
316 x |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
317 END |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
318 call assert_equal(expected, getline(1, '$')) |
efa773bec478
patch 8.2.3935: CTRL-U in Insert mode does not fix the indent
Bram Moolenaar <Bram@vim.org>
parents:
26811
diff
changeset
|
319 |
26516
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
320 bwipe! |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
321 endfunc |
9596c652420b
patch 8.2.3787: no proper formatting of a C line comment after a statement
Bram Moolenaar <Bram@vim.org>
parents:
25666
diff
changeset
|
322 |
13146
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
323 " Tests for :right, :center and :left on text with embedded TAB. |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
324 func Test_format_align() |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
325 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
326 set tw=65 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
327 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
328 " :left alignment |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
329 call append(0, [ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
330 \ " test for :left", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
331 \ " a a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
332 \ " fa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
333 \ " dfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
334 \ " sdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
335 \ " asdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
336 \ " xasdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
337 \ "asxxdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
338 \ ]) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
339 %left |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
340 call assert_equal([ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
341 \ "test for :left", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
342 \ "a a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
343 \ "fa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
344 \ "dfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
345 \ "sdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
346 \ "asdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
347 \ "xasdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
348 \ "asxxdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
349 \ "" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
350 \ ], getline(1, '$')) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
351 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
352 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
353 " :center alignment |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
354 call append(0, [ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
355 \ " test for :center", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
356 \ " a a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
357 \ " fa afd asdf", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
358 \ " dfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
359 \ " sdfa afd asdf", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
360 \ " asdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
361 \ " xasdfa asdfasdfasdfasdfasdf", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
362 \ "asxxdfa a" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
363 \ ]) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
364 %center |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
365 call assert_equal([ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
366 \ " test for :center", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
367 \ " a a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
368 \ " fa afd asdf", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
369 \ " dfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
370 \ " sdfa afd asdf", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
371 \ " asdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
372 \ " xasdfa asdfasdfasdfasdfasdf", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
373 \ " asxxdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
374 \ "" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
375 \ ], getline(1, '$')) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
376 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
377 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
378 " :right alignment |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
379 call append(0, [ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
380 \ " test for :right", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
381 \ " a a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
382 \ " fa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
383 \ " dfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
384 \ " sdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
385 \ " asdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
386 \ " xasdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
387 \ " asxxdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
388 \ " asxa;ofa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
389 \ " asdfaqwer a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
390 \ " a ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
391 \ " fa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
392 \ " dfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
393 \ " sdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
394 \ " asdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
395 \ " xasdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
396 \ " asxxdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
397 \ " asxa;ofa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
398 \ " asdfaqwer ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
399 \ " a axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
400 \ " fa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
401 \ " dfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
402 \ " sdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
403 \ " asdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
404 \ " xasdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
405 \ " asxxdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
406 \ " asxa;ofa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
407 \ " asdfaqwer axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
408 \ " a axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
409 \ " fa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
410 \ " dfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
411 \ " sdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
412 \ " asdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
413 \ " xasdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
414 \ " asxxdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
415 \ " asxa;ofa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
416 \ " asdfaqwer axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
417 \ " a axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
418 \ " fa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
419 \ " dfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
420 \ " sdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
421 \ " asdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
422 \ " xasdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
423 \ " asxxdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
424 \ " asxa;ofa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
425 \ " asdfaqwer axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
426 \ " a axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
427 \ " fa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
428 \ " dfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
429 \ " sdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
430 \ " asdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
431 \ " xasdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
432 \ " asxxdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
433 \ " asxa;ofa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
434 \ " asdfaqwer axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
435 \ " a axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
436 \ " fa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
437 \ " dfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
438 \ " sdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
439 \ " asdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
440 \ " xasdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
441 \ " asxxdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
442 \ " asxa;ofa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
443 \ " asdfaqwer axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
444 \ " a axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
445 \ " fa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
446 \ " dfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
447 \ " sdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
448 \ " asdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
449 \ " xasdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
450 \ " asxxdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
451 \ " asxa;ofa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
452 \ " asdfaqwer axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
453 \ " a axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
454 \ " fa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
455 \ " dfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
456 \ " sdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
457 \ " asdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
458 \ " xasdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
459 \ " asxxdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
460 \ " asxa;ofa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
461 \ " asdfaqwer axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
462 \ ]) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
463 %right |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
464 call assert_equal([ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
465 \ "\t\t\t\t test for :right", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
466 \ "\t\t\t\t a a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
467 \ "\t\t\t\t fa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
468 \ "\t\t\t\t dfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
469 \ "\t\t\t\t sdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
470 \ "\t\t\t\t asdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
471 \ "\t\t\t\t xasdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
472 \ "\t\t\t\t asxxdfa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
473 \ "\t\t\t\t asxa;ofa a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
474 \ "\t\t\t\t asdfaqwer a", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
475 \ "\t\t\t\t a ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
476 \ "\t\t\t\t fa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
477 \ "\t\t\t\t dfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
478 \ "\t\t\t\t sdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
479 \ "\t\t\t\t asdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
480 \ "\t\t\t\t xasdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
481 \ "\t\t\t\t asxxdfa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
482 \ "\t\t\t\t asxa;ofa ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
483 \ "\t\t\t\t asdfaqwer ax", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
484 \ "\t\t\t\t a axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
485 \ "\t\t\t\t fa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
486 \ "\t\t\t\t dfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
487 \ "\t\t\t\t sdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
488 \ "\t\t\t\t asdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
489 \ "\t\t\t\t xasdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
490 \ "\t\t\t\t asxxdfa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
491 \ "\t\t\t\t asxa;ofa axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
492 \ "\t\t\t\t asdfaqwer axx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
493 \ "\t\t\t\t a axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
494 \ "\t\t\t\t fa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
495 \ "\t\t\t\t dfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
496 \ "\t\t\t\t sdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
497 \ "\t\t\t\t asdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
498 \ "\t\t\t\t xasdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
499 \ "\t\t\t\t asxxdfa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
500 \ "\t\t\t\t asxa;ofa axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
501 \ "\t\t\t\t asdfaqwer axxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
502 \ "\t\t\t\t a axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
503 \ "\t\t\t\t fa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
504 \ "\t\t\t\t dfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
505 \ "\t\t\t\t sdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
506 \ "\t\t\t\t asdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
507 \ "\t\t\t\t xasdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
508 \ "\t\t\t\t asxxdfa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
509 \ "\t\t\t\t asxa;ofa axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
510 \ "\t\t\t\t asdfaqwer axxxo", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
511 \ "\t\t\t\t a axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
512 \ "\t\t\t\t fa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
513 \ "\t\t\t\t dfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
514 \ "\t\t\t\t sdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
515 \ "\t\t\t\t asdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
516 \ "\t\t\t\t xasdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
517 \ "\t\t\t\t asxxdfa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
518 \ "\t\t\t\t asxa;ofa axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
519 \ "\t\t\t\t asdfaqwer axxxoi", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
520 \ "\t\t\t\t a axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
521 \ "\t\t\t\t fa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
522 \ "\t\t\t\t dfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
523 \ "\t\t\t\t sdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
524 \ "\t\t\t\t asdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
525 \ "\t\t\t\t xasdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
526 \ "\t\t\t\t asxxdfa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
527 \ "\t\t\t\t asxa;ofa axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
528 \ "\t\t\t\t asdfaqwer axxxoik", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
529 \ "\t\t\t\t a axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
530 \ "\t\t\t\t fa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
531 \ "\t\t\t\t dfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
532 \ "\t\t\t\t sdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
533 \ "\t\t\t\t asdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
534 \ "\t\t\t\t xasdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
535 \ "\t\t\t\t asxxdfa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
536 \ "\t\t\t\t asxa;ofa axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
537 \ "\t\t\t\t asdfaqwer axxxoike", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
538 \ "\t\t\t\t a axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
539 \ "\t\t\t\t fa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
540 \ "\t\t\t\t dfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
541 \ "\t\t\t\t sdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
542 \ "\t\t\t\t asdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
543 \ "\t\t\t\t xasdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
544 \ "\t\t\t\t asxxdfa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
545 \ "\t\t\t\t asxa;ofa axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
546 \ "\t\t\t\t asdfaqwer axxxoikey", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
547 \ "" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
548 \ ], getline(1, '$')) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
549 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
550 |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
18910
diff
changeset
|
551 " align text with 'wrapmargin' |
19243
e053bf71b998
patch 8.2.0180: test for wrapmargin fails if terminal is not 80 columns
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
552 50vnew |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
18910
diff
changeset
|
553 call setline(1, ['Vim']) |
19243
e053bf71b998
patch 8.2.0180: test for wrapmargin fails if terminal is not 80 columns
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
554 setl textwidth=0 |
e053bf71b998
patch 8.2.0180: test for wrapmargin fails if terminal is not 80 columns
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
555 setl wrapmargin=30 |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
18910
diff
changeset
|
556 right |
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
18910
diff
changeset
|
557 call assert_equal("\t\t Vim", getline(1)) |
19243
e053bf71b998
patch 8.2.0180: test for wrapmargin fails if terminal is not 80 columns
Bram Moolenaar <Bram@vim.org>
parents:
19231
diff
changeset
|
558 q! |
19231
b8fd7364befd
patch 8.2.0174: various commands not completely tested
Bram Moolenaar <Bram@vim.org>
parents:
18910
diff
changeset
|
559 |
19277
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
560 " align text with 'rightleft' |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
561 if has('rightleft') |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
562 new |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
563 call setline(1, 'Vim') |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
564 setlocal rightleft |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
565 left 20 |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
566 setlocal norightleft |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
567 call assert_equal("\t\t Vim", getline(1)) |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
568 setlocal rightleft |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
569 right |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
570 setlocal norightleft |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
571 call assert_equal("Vim", getline(1)) |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
572 close! |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
573 endif |
1b02482e6a61
patch 8.2.0197: some Ex commands not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19243
diff
changeset
|
574 |
13146
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
575 set tw& |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
576 endfunc |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
577 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
578 " Test formatting a paragraph. |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
579 func Test_format_para() |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
580 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
581 set fo+=tcroql tw=72 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
582 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
583 call append(0, [ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
584 \ "xxxxx xx xxxxxx ", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
585 \ "xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
586 \ "xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
587 \ "xx xxxxxxx. xxxx xxxx.", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
588 \ "", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
589 \ "> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
590 \ "> xxxxxx xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
591 \ ]) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
592 exe "normal /xxxxxxxx$\<CR>" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
593 normal 0gq6kk |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
594 call assert_equal([ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
595 \ "xxxxx xx xxxxxx xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
596 \ "xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx xx xxxxxxx.", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
597 \ "xxxx xxxx.", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
598 \ "", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
599 \ "> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
600 \ "> xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
601 \ "" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
602 \ ], getline(1, '$')) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
603 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
604 set fo& tw& |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
605 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
606 endfunc |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
607 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
608 " Test undo after ":%s" and formatting. |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
609 func Test_format_undo() |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
610 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
611 map gg :.,.+2s/^/x/<CR>kk:set tw=3<CR>gqq |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
612 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
613 call append(0, [ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
614 \ "aa aa aa aa", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
615 \ "bb bb bb bb", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
616 \ "cc cc cc cc" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
617 \ ]) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
618 " undo/redo here to make the next undo only work on the following changes |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
619 exe "normal i\<C-G>u" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
620 call cursor(1,1) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
621 normal ggu |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
622 call assert_equal([ |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
623 \ "aa aa aa aa", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
624 \ "bb bb bb bb", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
625 \ "cc cc cc cc", |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
626 \ "" |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
627 \ ], getline(1, '$')) |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
628 |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
629 unmap gg |
15326
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
630 set tw& |
13146
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
631 enew! |
d9a94be389b5
patch 8.0.1447: still too many old style tests
Christian Brabandt <cb@256bit.org>
parents:
12851
diff
changeset
|
632 endfunc |
15326
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
633 |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
634 func Test_format_list_auto() |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
635 new |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
636 call setline(1, ['1. abc', '2. def', '3. ghi']) |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
637 set fo=tan ai bs=2 |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
638 call feedkeys("3G0lli\<BS>\<BS>x\<Esc>", 'tx') |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
639 call assert_equal('2. defx ghi', getline(2)) |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
640 bwipe! |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
641 set fo& ai& bs& |
fe428bee74b3
patch 8.1.0671: cursor in the wrong column after auto-formatting
Bram Moolenaar <Bram@vim.org>
parents:
13146
diff
changeset
|
642 endfunc |
18408
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
643 |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
644 func Test_crash_github_issue_5095() |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
645 CheckFeature autocmd |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
646 |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
647 " This used to segfault, see https://github.com/vim/vim/issues/5095 |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
648 augroup testing |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
649 au BufNew x center |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
650 augroup END |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
651 |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
652 next! x |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
653 |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
654 bw |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
655 augroup testing |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
656 au! |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
657 augroup END |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
658 augroup! testing |
50c0a9fb07ae
patch 8.1.2198: crash when using :center in autocommand
Bram Moolenaar <Bram@vim.org>
parents:
15440
diff
changeset
|
659 endfunc |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
660 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
661 " Test for formatting multi-byte text with 'fo=t' |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
662 func Test_tw_2_fo_t() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
663 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
664 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
665 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
666 XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
667 abc XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
668 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
669 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
670 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
671 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
672 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
673 set tw=2 fo=t |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
674 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
675 XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
676 abc XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
677 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
678 exe "normal gqgqjgqgq" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
679 exe "normal o\n" . join(t, "\n") |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
680 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
681 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
682 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
683 XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
684 abc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
685 XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
686 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
687 XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
688 abc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
689 XYZ |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
690 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
691 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
692 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
693 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
694 set tw& fo& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
695 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
696 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
697 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
698 " Test for formatting multi-byte text with 'fo=tm' and 'tw=1' |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
699 func Test_tw_1_fo_tm() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
700 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
701 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
702 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
703 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
704 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
705 X a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
706 XY |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
707 X Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
708 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
709 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
710 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
711 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
712 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
713 set tw=1 fo=tm |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
714 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
715 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
716 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
717 X a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
718 XY |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
719 X Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
720 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
721 exe "normal gqgqjgqgqjgqgqjgqgqjgqgq" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
722 exe "normal o\n" . join(t, "\n") |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
723 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
724 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
725 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
726 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
727 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
728 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
729 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
730 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
731 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
732 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
733 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
734 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
735 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
736 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
737 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
738 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
739 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
740 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
741 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
742 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
743 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
744 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
745 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
746 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
747 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
748 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
749 set tw& fo& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
750 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
751 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
752 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
753 " Test for formatting multi-byte text with 'fo=tm' and 'tw=2' |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
754 func Test_tw_2_fo_tm() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
755 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
756 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
757 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
758 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
759 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
760 X a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
761 XY |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
762 X Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
763 aX |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
764 abX |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
765 abcX |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
766 abX c |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
767 abXY |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
768 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
769 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
770 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
771 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
772 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
773 set tw=2 fo=tm |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
774 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
775 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
776 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
777 X a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
778 XY |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
779 X Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
780 aX |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
781 abX |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
782 abcX |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
783 abX c |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
784 abXY |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
785 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
786 exe "normal gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgq" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
787 exe "normal o\n" . join(t, "\n") |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
788 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
789 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
790 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
791 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
792 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
793 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
794 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
795 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
796 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
797 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
798 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
799 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
800 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
801 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
802 ab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
803 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
804 abc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
805 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
806 ab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
807 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
808 c |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
809 ab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
810 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
811 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
812 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
813 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
814 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
815 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
816 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
817 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
818 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
819 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
820 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
821 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
822 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
823 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
824 ab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
825 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
826 abc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
827 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
828 ab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
829 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
830 c |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
831 ab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
832 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
833 Y |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
834 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
835 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
836 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
837 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
838 set tw& fo& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
839 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
840 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
841 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
842 " Test for formatting multi-byte text with 'fo=tm', 'tw=2' and 'autoindent'. |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
843 func Test_tw_2_fo_tm_ai() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
844 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
845 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
846 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
847 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
848 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
849 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
850 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
851 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
852 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
853 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
854 set ai tw=2 fo=tm |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
855 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
856 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
857 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
858 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
859 exe "normal gqgqjgqgq" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
860 exe "normal o\n" . join(t, "\n") |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
861 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
862 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
863 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
864 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
865 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
866 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
867 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
868 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
869 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
870 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
871 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
872 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
873 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
874 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
875 set tw& fo& ai& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
876 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
877 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
878 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
879 " Test for formatting multi-byte text with 'fo=tm', 'tw=2' and 'noai'. |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
880 func Test_tw_2_fo_tm_noai() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
881 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
882 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
883 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
884 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
885 Xa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
886 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
887 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
888 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
889 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
890 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
891 set noai tw=2 fo=tm |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
892 exe "normal gqgqjgqgqo\n X\n Xa" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
893 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
894 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
895 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
896 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
897 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
898 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
899 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
900 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
901 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
902 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
903 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
904 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
905 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
906 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
907 set tw& fo& ai& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
908 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
909 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
910 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
911 func Test_tw_2_fo_tm_replace() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
912 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
913 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
914 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
915 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
916 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
917 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
918 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
919 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
920 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
921 set tw=2 fo=tm |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
922 exe "normal RXa" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
923 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
924 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
925 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
926 X |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
927 a |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
928 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
929 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
930 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
931 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
932 set tw& fo& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
933 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
934 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
935 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
936 " Test for 'matchpairs' with multibyte chars |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
937 func Test_mps_multibyte() |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
938 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
939 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
940 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
941 ‘ two three ’ four |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
942 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
943 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
944 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
945 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
946 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
947 exe "set mps+=\u2018:\u2019" |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
948 normal d% |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
949 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
950 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
951 { |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
952 four |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
953 } |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
954 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
955 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
956 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
957 set mps& |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
958 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
959 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
960 |
20199
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
961 " Test for 'matchpairs' in latin1 encoding |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
962 func Test_mps_latin1() |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
963 new |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
964 let save_enc = &encoding |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
965 set encoding=latin1 |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
966 call setline(1, 'abc(def)ghi') |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
967 normal % |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
968 call assert_equal(8, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
969 normal % |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
970 call assert_equal(4, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
971 call cursor(1, 6) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
972 normal [( |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
973 call assert_equal(4, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
974 normal % |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
975 call assert_equal(8, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
976 call cursor(1, 6) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
977 normal ]) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
978 call assert_equal(8, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
979 normal % |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
980 call assert_equal(4, col('.')) |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
981 let &encoding = save_enc |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
982 close! |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
983 endfunc |
a4bd28e2cf1d
patch 8.2.0655: search code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19906
diff
changeset
|
984 |
24307
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
985 func Test_empty_matchpairs() |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
986 split |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
987 set matchpairs= showmatch |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
988 call assert_nobeep('call feedkeys("ax\tx\t\<Esc>", "xt")') |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
989 set matchpairs& noshowmatch |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
990 bwipe! |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
991 endfunc |
55f458d35292
patch 8.2.2694: when 'matchpairs' is empty every character beeps
Bram Moolenaar <Bram@vim.org>
parents:
24101
diff
changeset
|
992 |
24101
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
993 func Test_mps_error() |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
994 let encoding_save = &encoding |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
995 |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
996 for e in ['utf-8', 'latin1'] |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
997 exe 'set encoding=' .. e |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
998 |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
999 call assert_fails('set mps=<:', 'E474:', e) |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1000 call assert_fails('set mps=:>', 'E474:', e) |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1001 call assert_fails('set mps=<>', 'E474:', e) |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1002 call assert_fails('set mps=<:>_', 'E474:', e) |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1003 endfor |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1004 |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1005 let &encoding = encoding_save |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1006 endfunc |
6d3dee0d7de5
patch 8.2.2592: code coverage could be improved
Bram Moolenaar <Bram@vim.org>
parents:
23241
diff
changeset
|
1007 |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1008 " Test for ra on multi-byte characters |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1009 func Test_ra_multibyte() |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1010 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1011 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1012 ra test |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1013 abba |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1014 aab |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1015 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1016 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1017 call cursor(1, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1018 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1019 normal jVjra |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1020 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1021 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1022 ra test |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1023 aaaa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1024 aaa |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1025 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1026 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1027 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1028 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1029 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1030 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1031 " Test for 'whichwrap' with multi-byte character |
18910
e8fe65da4198
patch 8.2.0016: test name used twice, option not restored properly
Bram Moolenaar <Bram@vim.org>
parents:
18906
diff
changeset
|
1032 func Test_whichwrap_multi_byte() |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1033 new |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1034 let t =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1035 á |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1036 x |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1037 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1038 call setline(1, t) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1039 call cursor(2, 1) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1040 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1041 set whichwrap+=h |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1042 normal dh |
18910
e8fe65da4198
patch 8.2.0016: test name used twice, option not restored properly
Bram Moolenaar <Bram@vim.org>
parents:
18906
diff
changeset
|
1043 set whichwrap& |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1044 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1045 let expected =<< trim END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1046 áx |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1047 END |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1048 call assert_equal(expected, getline(1, '$')) |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1049 |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1050 bwipe! |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1051 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1052 |
19852
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1053 " Test for 'a' and 'w' flags in 'formatoptions' |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1054 func Test_fo_a_w() |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1055 new |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1056 setlocal fo+=aw tw=10 |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1057 call feedkeys("iabc abc a abc\<Esc>k0weade", 'xt') |
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1058 call assert_equal(['abc abcde ', 'a abc'], getline(1, '$')) |
20261
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1059 |
20941
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1060 " when a line ends with space, it is not broken up. |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1061 %d |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1062 call feedkeys("ione two to ", 'xt') |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1063 call assert_equal('one two to ', getline(1)) |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1064 |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1065 " when a line ends with spaces and backspace is used in the next line, the |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1066 " last space in the previous line should be removed. |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1067 %d |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1068 set backspace=indent,eol,start |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1069 call setline(1, ['one ', 'two']) |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1070 exe "normal 2Gi\<BS>" |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1071 call assert_equal(['one two'], getline(1, '$')) |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1072 set backspace& |
505d97ea54da
patch 8.2.1022: various parts of code not covered by tests
Bram Moolenaar <Bram@vim.org>
parents:
20285
diff
changeset
|
1073 |
20261
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1074 " Test for 'a', 'w' and '1' options. |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1075 setlocal textwidth=0 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1076 setlocal fo=1aw |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1077 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1078 call setline(1, '. foo') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1079 normal 72ig |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1080 call feedkeys('a uu uu uu', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1081 call assert_equal('g uu uu ', getline(1)[-8:]) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1082 call assert_equal(['uu. foo'], getline(2, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1083 |
23241
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1084 " using backspace or "x" triggers reformat |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1085 call setline(1, ['1 2 3 4 5 ', '6 7 8 9']) |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1086 set tw=10 |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1087 set fo=taw |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1088 set bs=indent,eol,start |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1089 exe "normal 1G4la\<BS>\<BS>\<Esc>" |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1090 call assert_equal(['1 2 4 5 6 ', '7 8 9'], getline(1, 2)) |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1091 exe "normal f4xx" |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1092 call assert_equal(['1 2 5 6 7 ', '8 9'], getline(1, 2)) |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1093 |
25666
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1094 " using "cw" leaves cursor in right spot |
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1095 call setline(1, ['Now we g whether that nation, or', |
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1096 \ 'any nation so conceived and,']) |
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1097 set fo=tcqa tw=35 |
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1098 exe "normal 2G0cwx\<Esc>" |
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1099 call assert_equal(['Now we g whether that nation, or x', 'nation so conceived and,'], getline(1, 2)) |
649d3e9c5914
patch 8.2.3369: auto formatting after "cw" leaves cursor in wrong spot
Bram Moolenaar <Bram@vim.org>
parents:
24307
diff
changeset
|
1100 |
23241
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1101 set tw=0 |
87acfcf65a2e
patch 8.2.2166: auto format doesn't work when deleting text
Bram Moolenaar <Bram@vim.org>
parents:
20990
diff
changeset
|
1102 set fo& |
19852
12518b40c161
patch 8.2.0482: channel and sandbox code not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
19277
diff
changeset
|
1103 %bw! |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1104 endfunc |
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1105 |
20261
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1106 " Test for formatting lines using gq in visual mode |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1107 func Test_visual_gq_format() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1108 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1109 call setline(1, ['one two three four', 'five six', 'one two']) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1110 setl textwidth=10 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1111 call feedkeys('ggv$jj', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1112 redraw! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1113 normal gq |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1114 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1115 call setline(1, ['one two three four', 'five six', 'one two']) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1116 normal G$ |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1117 call feedkeys('v0kk', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1118 redraw! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1119 normal gq |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1120 setl textwidth& |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1121 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1122 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1123 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1124 " Test for 'n' flag in 'formatoptions' to format numbered lists |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1125 func Test_fo_n() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1126 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1127 setlocal autoindent |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1128 setlocal textwidth=12 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1129 setlocal fo=n |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1130 call setline(1, [' 1) one two three four', ' 2) two']) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1131 normal gggqG |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1132 call assert_equal([' 1) one two', ' three', ' four', ' 2) two'], |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1133 \ getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1134 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1135 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1136 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1137 " Test for 'formatlistpat' option |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1138 func Test_formatlistpat() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1139 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1140 setlocal autoindent |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1141 setlocal textwidth=10 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1142 setlocal fo=n |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1143 setlocal formatlistpat=^\\s*-\\s* |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1144 call setline(1, [' - one two three', ' - two']) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1145 normal gggqG |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1146 call assert_equal([' - one', ' two', ' three', ' - two'], |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1147 \ getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1148 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1149 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1150 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1151 " Test for the 'b' and 'v' flags in 'formatoptions' |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1152 " Text should wrap only if a space character is inserted at or before |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1153 " 'textwidth' |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1154 func Test_fo_b() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1155 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1156 setlocal textwidth=20 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1157 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1158 setlocal formatoptions=t |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1159 call setline(1, 'one two three four') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1160 call feedkeys('Amore', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1161 call assert_equal(['one two three', 'fourmore'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1162 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1163 setlocal formatoptions=bt |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1164 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1165 call setline(1, 'one two three four') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1166 call feedkeys('Amore five', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1167 call assert_equal(['one two three fourmore five'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1168 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1169 setlocal formatoptions=bt |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1170 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1171 call setline(1, 'one two three four') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1172 call feedkeys('A five', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1173 call assert_equal(['one two three four', 'five'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1174 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1175 setlocal formatoptions=vt |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1176 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1177 call setline(1, 'one two three four') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1178 call feedkeys('Amore five', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1179 call assert_equal(['one two three fourmore', 'five'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1180 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1181 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1182 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1183 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1184 " Test for the '1' flag in 'formatoptions'. Don't wrap text after a one letter |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1185 " word. |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1186 func Test_fo_1() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1187 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1188 setlocal textwidth=20 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1189 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1190 setlocal formatoptions=t |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1191 call setline(1, 'one two three four') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1192 call feedkeys('A a bird', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1193 call assert_equal(['one two three four a', 'bird'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1194 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1195 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1196 setlocal formatoptions=t1 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1197 call setline(1, 'one two three four') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1198 call feedkeys('A a bird', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1199 call assert_equal(['one two three four', 'a bird'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1200 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1201 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1202 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1203 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1204 " Test for 'l' flag in 'formatoptions'. When starting insert mode, if a line |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1205 " is longer than 'textwidth', then it is not broken. |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1206 func Test_fo_l() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1207 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1208 setlocal textwidth=20 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1209 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1210 setlocal formatoptions=t |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1211 call setline(1, 'one two three four five') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1212 call feedkeys('A six', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1213 call assert_equal(['one two three four', 'five six'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1214 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1215 %d |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1216 setlocal formatoptions=tl |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1217 call setline(1, 'one two three four five') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1218 call feedkeys('A six', 'xt') |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1219 call assert_equal(['one two three four five six'], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1220 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1221 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1222 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1223 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1224 " Test for the '2' flag in 'formatoptions' |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1225 func Test_fo_2() |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1226 new |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1227 setlocal autoindent |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1228 setlocal formatoptions=t2 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1229 setlocal textwidth=30 |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1230 call setline(1, ["\tfirst line of a paragraph.", |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1231 \ "second line of the same paragraph.", |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1232 \ "third line."]) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1233 normal gggqG |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1234 call assert_equal(["\tfirst line of a", |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1235 \ "paragraph. second line of the", |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1236 \ "same paragraph. third line."], getline(1, '$')) |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1237 close! |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1238 endfunc |
aafedd368f40
patch 8.2.0686: formatoptions not sufficiently tested
Bram Moolenaar <Bram@vim.org>
parents:
20199
diff
changeset
|
1239 |
18906
bb87c5c1e29b
patch 8.2.0014: test69 and test95 are old style
Bram Moolenaar <Bram@vim.org>
parents:
18408
diff
changeset
|
1240 " vim: shiftwidth=2 sts=2 expandtab |