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 searching for a pattern with a character offset and
12
starting in a closed fold. (Frank Butler)
13
Solution: Check for the column to be past the end of the line. Also fix
14
that a pattern with a character offset relative to the end isn't
15
read back from the viminfo properly.
19
*** ../vim-6.3.004/src/search.c Sun Jun 13 12:33:41 2004
20
--- src/search.c Wed Jun 16 10:46:17 2004
24
* If there is a character offset, subtract it from the current
25
* position, so we don't get stuck at "?pat?e+2" or "/pat/s-2".
26
* This is not done for a line offset, because then we would not be vi
29
! if (!spats[0].off.line && spats[0].off.off)
31
if (spats[0].off.off > 0)
35
* If there is a character offset, subtract it from the current
36
* position, so we don't get stuck at "?pat?e+2" or "/pat/s-2".
37
+ * Skip this if pos.col is near MAXCOL (closed fold).
38
* This is not done for a line offset, because then we would not be vi
41
! if (!spats[0].off.line && spats[0].off.off && pos.col < MAXCOL - 2)
43
if (spats[0].off.off > 0)
48
retval = 2; /* pattern found, line offset added */
52
/* to the right, check for end of file */
53
if (spats[0].off.off > 0)
56
retval = 2; /* pattern found, line offset added */
58
! else if (pos.col < MAXCOL - 2) /* just in case */
60
/* to the right, check for end of file */
61
if (spats[0].off.off > 0)
75
! off_end = SEARCH_END;
79
*** ../vim-6.3.004/src/version.c Sun Jun 13 12:33:41 2004
80
--- src/version.c Wed Jun 16 10:51:48 2004
84
{ /* Add new patch number below this line */
90
In a world without fences, who needs Gates and Windows?
92
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
93
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
94
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
95
\\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///