4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Crash when doing "d/\n/e" and 'virtualedit' is "all". (Andy Wokula)
12 Solution: Avoid that the column becomes negative. Also fixes other problems
13 with the end of a pattern match is in column zero. (A.Politz)
17 *** ../vim-7.1.257/src/search.c Sat Jan 26 21:15:00 2008
18 --- src/search.c Wed Feb 20 13:22:23 2008
22 submatch = first_submatch(®match);
24 ! /* Line me be past end of buffer for "\n\zs". */
25 if (lnum + matchpos.lnum > buf->b_ml.ml_line_count)
30 submatch = first_submatch(®match);
32 ! /* "lnum" may be past end of buffer for "\n\zs". */
33 if (lnum + matchpos.lnum > buf->b_ml.ml_line_count)
41 ! if (options & SEARCH_END && !(options & SEARCH_NOOF))
43 pos->lnum = lnum + endpos.lnum;
44 ! pos->col = endpos.col - 1;
48 ! /* 'e' offset may put us just below the last line */
49 ! if (pos->lnum > buf->b_ml.ml_line_count)
52 ! ptr = ml_get_buf(buf, pos->lnum, FALSE);
53 ! pos->col -= (*mb_head_off)(ptr, ptr + pos->col);
63 ! /* With the SEARCH_END option move to the last character
64 ! * of the match. Don't do it for an empty match, end
65 ! * should be same as start then. */
66 ! if (options & SEARCH_END && !(options & SEARCH_NOOF)
67 ! && !(matchpos.lnum == endpos.lnum
68 ! && matchpos.col == endpos.col))
70 + /* For a match in the first column, set the position
71 + * on the NUL in the previous line. */
72 pos->lnum = lnum + endpos.lnum;
73 ! pos->col = endpos.col;
74 ! if (endpos.col == 0)
76 ! if (pos->lnum > 1) /* just in case */
79 ! pos->col = (colnr_T)STRLEN(ml_get_buf(buf,
88 + && pos->lnum <= buf->b_ml.ml_line_count)
90 + ptr = ml_get_buf(buf, pos->lnum, FALSE);
91 + pos->col -= (*mb_head_off)(ptr, ptr + pos->col);
98 *** ../vim-7.1.257/src/version.c Wed Feb 20 12:43:05 2008
99 --- src/version.c Wed Feb 20 13:37:32 2008
103 { /* Add new patch number below this line */
109 Micro$oft: where do you want to go today?
110 Linux: where do you want to go tomorrow?
111 FreeBSD: are you guys coming, or what?
113 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
114 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
115 \\\ download, build and distribute -- http://www.A-A-P.org ///
116 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///