4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When using fold markers, three lines in a row have the start
12 marker and deleting the first one with "dd", a nested fold is not
13 deleted. (Kamil Burzynski)
14 Using marker folding, a level 1 fold doesn't stop when it is
15 followed by "{{{2", starting a level 2 fold.
16 Solution: Don't stop updating folds at the end of a change when the nesting
17 level of folds is larger than the fold level.
18 Correctly compute the number of folds that start at "{{{2".
19 Also avoid a crash for a NULL pointer.
23 *** ../vim-6.2.207/src/fold.c Mon Dec 29 20:30:12 2003
24 --- src/fold.c Sat Jan 24 17:01:17 2004
27 && getlevel != foldlevelExpr
28 && getlevel != foldlevelSyntax)
31 ! && foldFind(&fp->fd_nested, flp->lnum - fp->fd_top, &fp2))
32 ! bot = fp2->fd_top + fp2->fd_len - 1 + fp->fd_top;
33 else if (fp->fd_top + fp->fd_len <= flp->lnum && lvl >= level)
37 && getlevel != foldlevelExpr
38 && getlevel != foldlevelSyntax)
44 ! /* Compute how deep the folds currently are, if it's deeper
45 ! * than "lvl" then some must be deleted, need to update
46 ! * at least one nested fold. */
47 ! ll = flp->lnum - fp->fd_top;
48 ! while (foldFind(&fp2->fd_nested, ll, &fp2))
54 ! if (lvl < level + i)
56 ! foldFind(&fp->fd_nested, flp->lnum - fp->fd_top, &fp2);
58 ! bot = fp2->fd_top + fp2->fd_len - 1 + fp->fd_top;
60 else if (fp->fd_top + fp->fd_len <= flp->lnum && lvl >= level)
69 + int start_lvl = flp->lvl;
89 ! flp->start = n - start_lvl;
101 linenr_T lnum = flp->lnum + flp->off;
109 linenr_T lnum = flp->lnum + flp->off;
113 /* Use the maximum fold level at the start of this line and the next. */
114 flp->lvl = syn_get_foldlevel(flp->wp, lnum);
115 ! flp->start = FALSE;
116 if (lnum < flp->wp->w_buffer->b_ml.ml_line_count)
118 n = syn_get_foldlevel(flp->wp, lnum + 1);
121 /* Use the maximum fold level at the start of this line and the next. */
122 flp->lvl = syn_get_foldlevel(flp->wp, lnum);
124 if (lnum < flp->wp->w_buffer->b_ml.ml_line_count)
126 n = syn_get_foldlevel(flp->wp, lnum + 1);
127 *** ../vim-6.2.207/src/version.c Sun Jan 25 20:30:03 2004
128 --- src/version.c Sun Jan 25 20:32:00 2004
132 { /* Add new patch number below this line */
138 JOHN CLEESE PLAYED: SECOND SOLDIER WITH A KEEN INTEREST IN BIRDS, LARGE MAN
139 WITH DEAD BODY, BLACK KNIGHT, MR NEWT (A VILLAGE
140 BLACKSMITH INTERESTED IN BURNING WITCHES), A QUITE
141 EXTRAORDINARILY RUDE FRENCHMAN, TIM THE WIZARD, SIR
143 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
145 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
146 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
147 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
148 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///