4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: "do" and ":diffget" don't work in the first line and the last line
12 of a buffer. (Aron Griffis)
13 Solution: Find a difference above the first line and below the last line.
14 Also fix a few display updating bugs.
15 Files: src/diff.c, src/fold.c, src/move.c
18 *** ../vim-6.2.279/src/diff.c Tue Feb 17 21:36:55 2004
19 --- src/diff.c Thu Feb 19 21:35:17 2004
27 + /* Recompute the scroll binding, may remove or add filler lines (e.g.,
28 + * when adding lines above w_topline). */
29 + check_scrollbind((linenr_T)0, 0L);
36 int dofold; /* also recompute the folds */
41 for (wp = firstwin; wp != NULL; wp = wp->w_next)
46 if (dofold && foldmethodIsDiff(wp))
49 + /* A change may have made filler lines invalid, need to take care
50 + * of that for other windows. */
51 + if (wp != curwin && wp->w_topfill > 0)
53 + n = diff_check(wp, wp->w_topline);
54 + if (wp->w_topfill > n)
55 + wp->w_topfill = (n < 0 ? 0 : n);
65 ! /* When no range given include the line above the cursor. */
66 ! if (eap->addr_count == 0 && eap->line1 > 1)
69 if (eap->cmdidx == CMD_diffget)
75 ! /* When no range given include the line above or below the cursor. */
76 ! if (eap->addr_count == 0)
78 ! /* Make it possible that ":diffget" on the last line gets line below
79 ! * the cursor line when there is no difference above the cursor. */
80 ! if (eap->cmdidx == CMD_diffget
81 ! && eap->line1 == curbuf->b_ml.ml_line_count
82 ! && diff_check(curwin, eap->line1) == 0
83 ! && (eap->line1 == 1 || diff_check(curwin, eap->line1 - 1) == 0))
85 ! else if (eap->line1 > 0)
89 if (eap->cmdidx == CMD_diffget)
91 *** ../vim-6.2.279/src/fold.c Tue Jan 27 17:55:24 2004
92 --- src/fold.c Thu Feb 19 20:55:36 2004
96 /* foldUpdateAll() {{{2 */
98 ! * Update all lines in the current window for folding.
99 * Used when a fold setting changes or after reloading the buffer.
100 * The actual updating is postponed until fold info is used, to avoid doing
101 * every time a setting is changed or a syntax item is added.
104 /* foldUpdateAll() {{{2 */
106 ! * Update all lines in a window for folding.
107 * Used when a fold setting changes or after reloading the buffer.
108 * The actual updating is postponed until fold info is used, to avoid doing
109 * every time a setting is changed or a syntax item is added.
114 win->w_foldinvalid = TRUE;
115 ! redraw_later(NOT_VALID);
118 /* foldMoveTo() {{{2 */
122 win->w_foldinvalid = TRUE;
123 ! redraw_win_later(win, NOT_VALID);
126 /* foldMoveTo() {{{2 */
127 *** ../vim-6.2.279/src/move.c Thu Feb 13 20:08:09 2003
128 --- src/move.c Thu Feb 19 19:47:30 2004
131 check_topline = TRUE;
132 else if (check_top_offset())
133 check_topline = TRUE;
135 /* Check if there are more filler lines than allowed. */
136 ! else if (curwin->w_topfill > diff_check_fill(curwin,
138 ! check_topline = TRUE;
145 check_topline = TRUE;
146 else if (check_top_offset())
147 check_topline = TRUE;
150 /* Check if there are more filler lines than allowed. */
151 ! if (!check_topline && curwin->w_topfill > diff_check_fill(curwin,
153 ! check_topline = TRUE;
161 if (lnum == wp->w_topline)
162 wp->w_cline_row += plines_win_nofill(wp, lnum++, TRUE)
166 wp->w_cline_row += plines_win(wp, lnum++, TRUE);
169 if (lnum == wp->w_topline)
170 wp->w_cline_row += plines_win_nofill(wp, lnum++, TRUE)
174 wp->w_cline_row += plines_win(wp, lnum++, TRUE);
175 *** ../vim-6.2.279/src/version.c Thu Feb 19 15:31:20 2004
176 --- src/version.c Fri Feb 20 21:33:40 2004
180 { /* Add new patch number below this line */
186 $ echo pizza > /dev/oven
188 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
189 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
190 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
191 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///