1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: With '$' in 'cpoptions' the $ is not displayed in the first
13 Solution: Use -1 instead of 0 as a special value. (Hideki Eiraku and
15 Files: src/edit.c, src/globals.h, src/move.c, src/screen.c, src/search.c
18 *** ../vim-7.3.425/src/edit.c 2012-01-26 18:58:25.000000000 +0100
19 --- src/edit.c 2012-02-04 23:23:45.000000000 +0100
28 redrawWinline(curwin->w_cursor.lnum, FALSE);
35 ! if (dollar_vcol >= 0)
38 redrawWinline(curwin->w_cursor.lnum, FALSE);
43 compl_curr_match->cp_number);
44 edit_submode_extra = match_ref;
45 edit_submode_highl = HLF_R;
51 compl_curr_match->cp_number);
52 edit_submode_extra = match_ref;
53 edit_submode_highl = HLF_R;
54 ! if (dollar_vcol >= 0)
60 * We can emulate the vi behaviour by pretending there is a dollar
61 * displayed even when there isn't.
62 * --pkv Sun Jan 19 01:56:40 EST 2003 */
63 ! if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == 0)
64 dollar_vcol = curwin->w_virtcol;
68 * We can emulate the vi behaviour by pretending there is a dollar
69 * displayed even when there isn't.
70 * --pkv Sun Jan 19 01:56:40 EST 2003 */
71 ! if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == -1)
72 dollar_vcol = curwin->w_virtcol;
75 *** ../vim-7.3.425/src/globals.h 2011-05-10 16:41:13.000000000 +0200
76 --- src/globals.h 2012-02-04 23:24:07.000000000 +0100
79 * When '$' is included in 'cpoptions' option set:
80 * When a change command is given that deletes only part of a line, a dollar
81 * is put at the end of the changed text. dollar_vcol is set to the virtual
82 ! * column of this '$'.
84 ! EXTERN colnr_T dollar_vcol INIT(= 0);
86 #ifdef FEAT_INS_EXPAND
89 * When '$' is included in 'cpoptions' option set:
90 * When a change command is given that deletes only part of a line, a dollar
91 * is put at the end of the changed text. dollar_vcol is set to the virtual
92 ! * column of this '$'. -1 is used to indicate no $ is being displayed.
94 ! EXTERN colnr_T dollar_vcol INIT(= -1);
96 #ifdef FEAT_INS_EXPAND
98 *** ../vim-7.3.425/src/move.c 2012-01-10 22:26:12.000000000 +0100
99 --- src/move.c 2012-02-04 23:21:08.000000000 +0100
106 if (curwin->w_skipcol != 0)
108 curwin->w_skipcol = 0;
114 if (curwin->w_skipcol != 0)
116 curwin->w_skipcol = 0;
120 /* remove '$' from change command when cursor moves onto it */
121 if (startcol > dollar_vcol)
124 extra = curwin_col_off();
125 curwin->w_wcol = curwin->w_virtcol + extra;
128 /* remove '$' from change command when cursor moves onto it */
129 if (startcol > dollar_vcol)
132 extra = curwin_col_off();
133 curwin->w_wcol = curwin->w_virtcol + extra;
134 *** ../vim-7.3.425/src/screen.c 2012-01-10 22:26:12.000000000 +0100
135 --- src/screen.c 2012-02-04 23:22:44.000000000 +0100
138 * When at start of changed lines: May scroll following lines
139 * up or down to minimize redrawing.
140 * Don't do this when the change continues until the end.
141 ! * Don't scroll when dollar_vcol is non-zero, keep the "$".
144 && mod_bot != MAXLNUM
145 ! && !(dollar_vcol != 0 && mod_bot == mod_top + 1))
150 * When at start of changed lines: May scroll following lines
151 * up or down to minimize redrawing.
152 * Don't do this when the change continues until the end.
153 ! * Don't scroll when dollar_vcol >= 0, keep the "$".
156 && mod_bot != MAXLNUM
157 ! && !(dollar_vcol >= 0 && mod_bot == mod_top + 1))
163 if (row > wp->w_height) /* past end of screen */
165 /* we may need the size of that too long line later on */
166 ! if (dollar_vcol == 0)
167 wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
171 ! if (dollar_vcol == 0)
172 wp->w_lines[idx].wl_size = row - srow;
176 if (row > wp->w_height) /* past end of screen */
178 /* we may need the size of that too long line later on */
179 ! if (dollar_vcol == -1)
180 wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
184 ! if (dollar_vcol == -1)
185 wp->w_lines[idx].wl_size = row - srow;
193 ! else if (dollar_vcol == 0)
194 wp->w_botline = lnum;
196 /* make sure the rest of the screen is blank */
201 ! else if (dollar_vcol == -1)
202 wp->w_botline = lnum;
204 /* make sure the rest of the screen is blank */
207 wp->w_old_botfill = wp->w_botfill;
210 ! if (dollar_vcol == 0)
213 * There is a trick with w_botline. If we invalidate it on each
215 wp->w_old_botfill = wp->w_botfill;
218 ! if (dollar_vcol == -1)
221 * There is a trick with w_botline. If we invalidate it on each
226 /* When still displaying '$' of change command, stop at cursor */
227 ! if (dollar_vcol != 0 && wp == curwin
228 && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
234 /* When still displaying '$' of change command, stop at cursor */
235 ! if (dollar_vcol >= 0 && wp == curwin
236 && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
239 *** ../vim-7.3.425/src/search.c 2012-01-26 20:58:21.000000000 +0100
240 --- src/search.c 2012-02-04 23:23:10.000000000 +0100
244 /* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
245 * stop displaying the "$". */
246 ! if (dollar_vcol > 0 && dollar_vcol == curwin->w_virtcol)
248 ++curwin->w_virtcol; /* do display ')' just before "$" */
249 update_screen(VALID); /* show the new char first */
253 /* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
254 * stop displaying the "$". */
255 ! if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol)
257 ++curwin->w_virtcol; /* do display ')' just before "$" */
258 update_screen(VALID); /* show the new char first */
260 *** ../vim-7.3.425/src/version.c 2012-02-04 22:44:27.000000000 +0100
261 --- src/version.c 2012-02-04 23:32:55.000000000 +0100
265 { /* Add new patch number below this line */
272 I am also told that there is a logical proof out there somewhere
273 that demonstrates that there is no task which duct tape cannot handle.
276 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
277 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
278 \\\ an exciting new programming language -- http://www.Zimbu.org ///
279 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///