1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
To: vim_dev@googlegroups.com
Subject: Patch 7.3.426
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.3.426
Problem: With '$' in 'cpoptions' the $ is not displayed in the first
column.
Solution: Use -1 instead of 0 as a special value. (Hideki Eiraku and
Hirohito Higashi)
Files: src/edit.c, src/globals.h, src/move.c, src/screen.c, src/search.c
*** ../vim-7.3.425/src/edit.c 2012-01-26 18:58:25.000000000 +0100
--- src/edit.c 2012-02-04 23:23:45.000000000 +0100
***************
*** 1763,1771 ****
static void
undisplay_dollar()
{
! if (dollar_vcol)
{
! dollar_vcol = 0;
redrawWinline(curwin->w_cursor.lnum, FALSE);
}
}
--- 1763,1771 ----
static void
undisplay_dollar()
{
! if (dollar_vcol >= 0)
{
! dollar_vcol = -1;
redrawWinline(curwin->w_cursor.lnum, FALSE);
}
}
***************
*** 5441,5447 ****
compl_curr_match->cp_number);
edit_submode_extra = match_ref;
edit_submode_highl = HLF_R;
! if (dollar_vcol)
curs_columns(FALSE);
}
}
--- 5441,5447 ----
compl_curr_match->cp_number);
edit_submode_extra = match_ref;
edit_submode_highl = HLF_R;
! if (dollar_vcol >= 0)
curs_columns(FALSE);
}
}
***************
*** 8961,8967 ****
* We can emulate the vi behaviour by pretending there is a dollar
* displayed even when there isn't.
* --pkv Sun Jan 19 01:56:40 EST 2003 */
! if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == 0)
dollar_vcol = curwin->w_virtcol;
#ifdef FEAT_FOLDING
--- 8961,8967 ----
* We can emulate the vi behaviour by pretending there is a dollar
* displayed even when there isn't.
* --pkv Sun Jan 19 01:56:40 EST 2003 */
! if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == -1)
dollar_vcol = curwin->w_virtcol;
#ifdef FEAT_FOLDING
*** ../vim-7.3.425/src/globals.h 2011-05-10 16:41:13.000000000 +0200
--- src/globals.h 2012-02-04 23:24:07.000000000 +0100
***************
*** 113,121 ****
* When '$' is included in 'cpoptions' option set:
* When a change command is given that deletes only part of a line, a dollar
* is put at the end of the changed text. dollar_vcol is set to the virtual
! * column of this '$'.
*/
! EXTERN colnr_T dollar_vcol INIT(= 0);
#ifdef FEAT_INS_EXPAND
/*
--- 113,121 ----
* When '$' is included in 'cpoptions' option set:
* When a change command is given that deletes only part of a line, a dollar
* is put at the end of the changed text. dollar_vcol is set to the virtual
! * column of this '$'. -1 is used to indicate no $ is being displayed.
*/
! EXTERN colnr_T dollar_vcol INIT(= -1);
#ifdef FEAT_INS_EXPAND
/*
*** ../vim-7.3.425/src/move.c 2012-01-10 22:26:12.000000000 +0100
--- src/move.c 2012-02-04 23:21:08.000000000 +0100
***************
*** 362,368 ****
#endif
)
{
! dollar_vcol = 0;
if (curwin->w_skipcol != 0)
{
curwin->w_skipcol = 0;
--- 362,368 ----
#endif
)
{
! dollar_vcol = -1;
if (curwin->w_skipcol != 0)
{
curwin->w_skipcol = 0;
***************
*** 966,972 ****
/* remove '$' from change command when cursor moves onto it */
if (startcol > dollar_vcol)
! dollar_vcol = 0;
extra = curwin_col_off();
curwin->w_wcol = curwin->w_virtcol + extra;
--- 966,972 ----
/* remove '$' from change command when cursor moves onto it */
if (startcol > dollar_vcol)
! dollar_vcol = -1;
extra = curwin_col_off();
curwin->w_wcol = curwin->w_virtcol + extra;
*** ../vim-7.3.425/src/screen.c 2012-01-10 22:26:12.000000000 +0100
--- src/screen.c 2012-02-04 23:22:44.000000000 +0100
***************
*** 1637,1647 ****
* When at start of changed lines: May scroll following lines
* up or down to minimize redrawing.
* Don't do this when the change continues until the end.
! * Don't scroll when dollar_vcol is non-zero, keep the "$".
*/
if (lnum == mod_top
&& mod_bot != MAXLNUM
! && !(dollar_vcol != 0 && mod_bot == mod_top + 1))
{
int old_rows = 0;
int new_rows = 0;
--- 1637,1647 ----
* When at start of changed lines: May scroll following lines
* up or down to minimize redrawing.
* Don't do this when the change continues until the end.
! * Don't scroll when dollar_vcol >= 0, keep the "$".
*/
if (lnum == mod_top
&& mod_bot != MAXLNUM
! && !(dollar_vcol >= 0 && mod_bot == mod_top + 1))
{
int old_rows = 0;
int new_rows = 0;
***************
*** 1868,1879 ****
if (row > wp->w_height) /* past end of screen */
{
/* we may need the size of that too long line later on */
! if (dollar_vcol == 0)
wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
++idx;
break;
}
! if (dollar_vcol == 0)
wp->w_lines[idx].wl_size = row - srow;
++idx;
#ifdef FEAT_FOLDING
--- 1868,1879 ----
if (row > wp->w_height) /* past end of screen */
{
/* we may need the size of that too long line later on */
! if (dollar_vcol == -1)
wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
++idx;
break;
}
! if (dollar_vcol == -1)
wp->w_lines[idx].wl_size = row - srow;
++idx;
#ifdef FEAT_FOLDING
***************
*** 1990,1996 ****
}
#endif
}
! else if (dollar_vcol == 0)
wp->w_botline = lnum;
/* make sure the rest of the screen is blank */
--- 1990,1996 ----
}
#endif
}
! else if (dollar_vcol == -1)
wp->w_botline = lnum;
/* make sure the rest of the screen is blank */
***************
*** 2005,2011 ****
wp->w_old_botfill = wp->w_botfill;
#endif
! if (dollar_vcol == 0)
{
/*
* There is a trick with w_botline. If we invalidate it on each
--- 2005,2011 ----
wp->w_old_botfill = wp->w_botfill;
#endif
! if (dollar_vcol == -1)
{
/*
* There is a trick with w_botline. If we invalidate it on each
***************
*** 3564,3570 ****
}
/* When still displaying '$' of change command, stop at cursor */
! if (dollar_vcol != 0 && wp == curwin
&& lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
#ifdef FEAT_DIFF
&& filler_todo <= 0
--- 3564,3570 ----
}
/* When still displaying '$' of change command, stop at cursor */
! if (dollar_vcol >= 0 && wp == curwin
&& lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
#ifdef FEAT_DIFF
&& filler_todo <= 0
*** ../vim-7.3.425/src/search.c 2012-01-26 20:58:21.000000000 +0100
--- src/search.c 2012-02-04 23:23:10.000000000 +0100
***************
*** 2501,2508 ****
save_siso = p_siso;
/* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
* stop displaying the "$". */
! if (dollar_vcol > 0 && dollar_vcol == curwin->w_virtcol)
! dollar_vcol = 0;
++curwin->w_virtcol; /* do display ')' just before "$" */
update_screen(VALID); /* show the new char first */
--- 2501,2508 ----
save_siso = p_siso;
/* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
* stop displaying the "$". */
! if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol)
! dollar_vcol = -1;
++curwin->w_virtcol; /* do display ')' just before "$" */
update_screen(VALID); /* show the new char first */
*** ../vim-7.3.425/src/version.c 2012-02-04 22:44:27.000000000 +0100
--- src/version.c 2012-02-04 23:32:55.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
{ /* Add new patch number below this line */
+ /**/
+ 426,
/**/
--
I am also told that there is a logical proof out there somewhere
that demonstrates that there is no task which duct tape cannot handle.
-- Paul Brannan
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|