annotate src/testdir/test29.in @ 14989:85467d180844 v8.1.0506

patch 8.1.0506: modeline test fails when run by root commit https://github.com/vim/vim/commit/9691f82f862ed18c2e3e48f9d2cd902bb947f803 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 3 19:06:25 2018 +0100 patch 8.1.0506: modeline test fails when run by root Problem: Modeline test fails when run by root. Solution: Set 'modeline' for the test. (James McCoy, closes https://github.com/vim/vim/issues/3592)
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Nov 2018 19:15:08 +0100
parents ae45d497868f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2291
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
1 Test for joining lines and marks in them
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
2 in compatible and nocompatible modes
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
3 and with 'joinspaces' set or not
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 and with 'cpoptions' flag 'j' set or not
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 STARTTEST
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
7 :so small.vim
2456
2876ac15b8c8 Avoid that running tests changes viminfo.
Bram Moolenaar <bram@vim.org>
parents: 2291
diff changeset
8 :set nocompatible viminfo+=nviminfo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 :set nojoinspaces
2291
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
10 :set cpoptions-=j
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 /firstline/
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
12 j"td/^STARTTEST/-1
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
13 PJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
2291
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
14 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
15 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
17 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjd/STARTTEST/-2
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 ENDTEST
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 firstline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 asdfasdf.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 asdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 asdfasdf
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 asdf
2291
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
49 zx cvn.
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
50 as dfg?
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
51 hjkl iop!
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
52 ert
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
53 zx cvn.
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
54 as dfg?
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
55 hjkl iop!
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
56 ert
f412e141c821 Improve test for joining lines. (Milan Vancura)
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
57
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
58 STARTTEST
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
59 /^{/+1
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
60 :set comments=s1:/*,mb:*,ex:*/,://
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
61 :set nojoinspaces fo=j
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
62 :set backspace=eol,start
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
63 :.,+3join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
64 j4J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
65 :.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
66 j3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
67 :.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
68 j3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
69 :.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
70 jj3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
71 ENDTEST
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
72
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
73 {
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
74
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
75 /*
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
76 * Make sure the previous comment leader is not removed.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
77 */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
78
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
79 /*
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
80 * Make sure the previous comment leader is not removed.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
81 */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
82
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
83 // Should the next comment leader be left alone?
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
84 // Yes.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
85
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
86 // Should the next comment leader be left alone?
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
87 // Yes.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
88
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
89 /* Here the comment leader should be left intact. */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
90 // And so should this one.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
91
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
92 /* Here the comment leader should be left intact. */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
93 // And so should this one.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
94
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
95 if (condition) // Remove the next comment leader!
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
96 // OK, I will.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
97 action();
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
98
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
99 if (condition) // Remove the next comment leader!
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
100 // OK, I will.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
101 action();
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
102 }
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
103
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
104 STARTTEST
5852
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
105 :" Test with backspace set to the non-compatible setting
11091
ae45d497868f patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents: 7003
diff changeset
106 :set belloff=all
5852
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
107 /^\d\+ this
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
108 :set cp bs=2
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
109 Avim1
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
110 Avim2u
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
111 :set cpo-=<
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
112 :inoremap <c-u> <left><c-u>
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
113 Avim3
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
114 :iunmap <c-u>
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
115 Avim4
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
116 :" Test with backspace set to the compatible setting
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5852
diff changeset
117 :set backspace= visualbell
5852
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
118 A vim5A
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
119 A vim6Azweiu
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
120 :inoremap <c-u> <left><c-u>
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
121 A vim7
7003
bc269cf15ccd patch 7.4.819
Bram Moolenaar <bram@vim.org>
parents: 5852
diff changeset
122 :set compatible novisualbell
5852
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
123 ENDTEST
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
124 1 this shouldn't be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
125 2 this shouldn't be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
126 3 this shouldn't be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
127 4 this should be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
128 5 this shouldn't be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
129 6 this shouldn't be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
130 7 this shouldn't be deleted
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
131 8 this shouldn't be deleted (not touched yet)
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
132
81c26975e8f9 updated for version 7.4.269
Bram Moolenaar <bram@vim.org>
parents: 3580
diff changeset
133 STARTTEST
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
134 /^{/+1
3580
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
135 :set comments=sO:*\ -,mO:*\ \ ,exO:*/
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
136 :set comments+=s1:/*,mb:*,ex:*/,://
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
137 :set comments+=s1:>#,mb:#,ex:#<,:<
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
138 :set cpoptions-=j joinspaces fo=j
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
139 :set backspace=eol,start
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
140 :.,+3join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
141 j4J
3580
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
142 :.,+8join
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
143 j9J
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
144 :.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
145 j3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
146 :.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
147 j3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
148 :.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
149 jj3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
150 j:.,+2join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
151 jj3J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
152 j:.,+5join
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
153 j6J
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
154 oSome code! // Make sure backspacing does not remove this comment leader.0i
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
155 ENDTEST
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
156
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
157 {
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
158
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
159 /*
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
160 * Make sure the previous comment leader is not removed.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
161 */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
162
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
163 /*
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
164 * Make sure the previous comment leader is not removed.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
165 */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
166
3580
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
167 /* List:
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
168 * - item1
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
169 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
170 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
171 * - item2
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
172 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
173 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
174 */
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
175
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
176 /* List:
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
177 * - item1
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
178 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
179 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
180 * - item2
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
181 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
182 * foo bar baz
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
183 */
297771eff080 updated for version 7.3.550
Bram Moolenaar <bram@vim.org>
parents: 3562
diff changeset
184
3562
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
185 // Should the next comment leader be left alone?
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
186 // Yes.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
187
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
188 // Should the next comment leader be left alone?
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
189 // Yes.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
190
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
191 /* Here the comment leader should be left intact. */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
192 // And so should this one.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
193
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
194 /* Here the comment leader should be left intact. */
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
195 // And so should this one.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
196
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
197 if (condition) // Remove the next comment leader!
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
198 // OK, I will.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
199 action();
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
200
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
201 if (condition) // Remove the next comment leader!
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
202 // OK, I will.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
203 action();
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
204
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
205 int i = 7 /* foo *// 3
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
206 // comment
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
207 ;
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
208
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
209 int i = 7 /* foo *// 3
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
210 // comment
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
211 ;
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
212
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
213 ># Note that the last character of the ending comment leader (left angle
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
214 # bracket) is a comment leader itself. Make sure that this comment leader is
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
215 # not removed from the next line #<
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
216 < On this line a new comment is opened which spans 2 lines. This comment should
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
217 < retain its comment leader.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
218
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
219 ># Note that the last character of the ending comment leader (left angle
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
220 # bracket) is a comment leader itself. Make sure that this comment leader is
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
221 # not removed from the next line #<
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
222 < On this line a new comment is opened which spans 2 lines. This comment should
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
223 < retain its comment leader.
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
224
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
225 }
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
226
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
227 STARTTEST
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
228 :g/^STARTTEST/.,/^ENDTEST/d
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
229 :?firstline?+1,$w! test.out
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
230 :qa!
5c1aaf9b4b1b updated for version 7.3.541
Bram Moolenaar <bram@vim.org>
parents: 2456
diff changeset
231 ENDTEST