4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When deleting a fold that is specified with markers the cursor
12 position may be wrong. Folds may not be displayed properly after
13 a delete. Wrong fold may be deleted.
14 Solution: Fix the problems. (mostly by Lech Lorens)
18 *** ../vim-7.2.077/src/fold.c Fri Nov 28 21:26:50 2008
19 --- src/fold.c Tue Jan 6 14:53:26 2009
23 fold_T *found_fp = NULL;
24 linenr_T found_off = 0;
25 ! int use_level = FALSE;
26 int maybe_small = FALSE;
28 linenr_T lnum = start;
31 fold_T *found_fp = NULL;
32 linenr_T found_off = 0;
34 int maybe_small = FALSE;
36 linenr_T lnum = start;
40 gap = &curwin->w_folds;
46 if (!foldFind(gap, lnum - lnum_off, &fp))
51 lnum = found_fp->fd_top + found_fp->fd_len + found_off;
54 if (foldmethodIsManual(curwin))
55 deleteFoldEntry(found_ga,
56 (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
59 ! if (found_fp->fd_top + found_off < first_lnum)
60 ! first_lnum = found_fp->fd_top;
61 ! if (lnum > last_lnum)
63 ! parseMarker(curwin);
64 deleteFoldMarkers(found_fp, recursive, found_off);
68 changed_window_setting();
72 lnum = found_fp->fd_top + found_fp->fd_len + found_off;
74 if (foldmethodIsManual(curwin))
75 deleteFoldEntry(found_ga,
76 (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
79 ! if (first_lnum > found_fp->fd_top + found_off)
80 ! first_lnum = found_fp->fd_top + found_off;
81 ! if (last_lnum < lnum)
84 ! parseMarker(curwin);
85 deleteFoldMarkers(found_fp, recursive, found_off);
90 changed_window_setting();
94 redraw_curbuf_later(INVERTED);
98 + /* Deleting markers may make cursor column invalid. */
102 changed_lines(first_lnum, (colnr_T)0, last_lnum, 0L);
104 *** ../vim-7.2.077/src/version.c Wed Dec 31 16:20:54 2008
105 --- src/version.c Tue Jan 6 15:00:36 2009
109 { /* Add new patch number below this line */
115 Looking at Perl through Lisp glasses, Perl looks atrocious.
117 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
118 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
119 \\\ download, build and distribute -- http://www.A-A-P.org ///
120 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///