| To: vim-dev@vim.org |
| Subject: Patch 7.2.078 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.2.078 |
| Problem: When deleting a fold that is specified with markers the cursor |
| position may be wrong. Folds may not be displayed properly after |
| a delete. Wrong fold may be deleted. |
| Solution: Fix the problems. (mostly by Lech Lorens) |
| Files: src/fold.c |
| |
| |
| |
| |
| |
| *** 740,746 **** |
| garray_T *found_ga; |
| fold_T *found_fp = NULL; |
| linenr_T found_off = 0; |
| ! int use_level = FALSE; |
| int maybe_small = FALSE; |
| int level = 0; |
| linenr_T lnum = start; |
| --- 740,746 ---- |
| garray_T *found_ga; |
| fold_T *found_fp = NULL; |
| linenr_T found_off = 0; |
| ! int use_level; |
| int maybe_small = FALSE; |
| int level = 0; |
| linenr_T lnum = start; |
| |
| *** 757,762 **** |
| --- 757,763 ---- |
| gap = &curwin->w_folds; |
| found_ga = NULL; |
| lnum_off = 0; |
| + use_level = FALSE; |
| for (;;) |
| { |
| if (!foldFind(gap, lnum - lnum_off, &fp)) |
| |
| *** 783,802 **** |
| else |
| { |
| lnum = found_fp->fd_top + found_fp->fd_len + found_off; |
| - did_one = TRUE; |
| |
| if (foldmethodIsManual(curwin)) |
| deleteFoldEntry(found_ga, |
| (int)(found_fp - (fold_T *)found_ga->ga_data), recursive); |
| else |
| { |
| ! if (found_fp->fd_top + found_off < first_lnum) |
| ! first_lnum = found_fp->fd_top; |
| ! if (lnum > last_lnum) |
| last_lnum = lnum; |
| ! parseMarker(curwin); |
| deleteFoldMarkers(found_fp, recursive, found_off); |
| } |
| |
| /* redraw window */ |
| changed_window_setting(); |
| --- 784,804 ---- |
| else |
| { |
| lnum = found_fp->fd_top + found_fp->fd_len + found_off; |
| |
| if (foldmethodIsManual(curwin)) |
| deleteFoldEntry(found_ga, |
| (int)(found_fp - (fold_T *)found_ga->ga_data), recursive); |
| else |
| { |
| ! if (first_lnum > found_fp->fd_top + found_off) |
| ! first_lnum = found_fp->fd_top + found_off; |
| ! if (last_lnum < lnum) |
| last_lnum = lnum; |
| ! if (!did_one) |
| ! parseMarker(curwin); |
| deleteFoldMarkers(found_fp, recursive, found_off); |
| } |
| + did_one = TRUE; |
| |
| /* redraw window */ |
| changed_window_setting(); |
| |
| *** 811,816 **** |
| --- 813,822 ---- |
| redraw_curbuf_later(INVERTED); |
| #endif |
| } |
| + else |
| + /* Deleting markers may make cursor column invalid. */ |
| + check_cursor_col(); |
| + |
| if (last_lnum > 0) |
| changed_lines(first_lnum, (colnr_T)0, last_lnum, 0L); |
| } |
| |
| |
| |
| *** 678,679 **** |
| --- 678,681 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 78, |
| /**/ |
| |
| -- |
| Looking at Perl through Lisp glasses, Perl looks atrocious. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ download, build and distribute -- http://www.A-A-P.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |