{
int count = 0;
- while (first <= last)
+ while (first <= last && (!limit_winheight || count < wp->w_height))
{
#ifdef FEAT_FOLDING
int x;
#endif
{
#ifdef FEAT_DIFF
- if (first == wp->w_buffer->b_ml.ml_line_count)
- count += diff_check_fill(wp, first + 1);
if (first == wp->w_topline)
- count += plines_win_nofill(wp, first, limit_winheight)
- + wp->w_topfill;
+ count += plines_win_nofill(wp, first, FALSE) + wp->w_topfill;
else
#endif
- count += plines_win(wp, first, limit_winheight);
+ count += plines_win(wp, first, FALSE);
++first;
}
}
+#ifdef FEAT_DIFF
+ if (first == wp->w_buffer->b_ml.ml_line_count + 1)
+ count += diff_check_fill(wp, first);
+#endif
+ if (limit_winheight && count > wp->w_height)
+ return wp->w_height;
return (count);
}
{
int n = plines_correct_topline(curwin, curwin->w_topline, FALSE);
if (n - count < curwin->w_height && curwin->w_topline < buflen)
- n += plines_m_win(curwin, curwin->w_topline + 1, buflen, TRUE);
+ n += plines_m_win(curwin, curwin->w_topline + 1, buflen, FALSE);
if (n - count < curwin->w_height)
count = n - curwin->w_height;
}
wp->w_topline = wp->w_buffer->b_ml.ml_line_count;
while (wp->w_topline < wp->w_cursor.lnum
&& wp->w_topline < wp->w_buffer->b_ml.ml_line_count
- && plines_m_win(wp, wp->w_topline, wp->w_cursor.lnum, TRUE)
+ && plines_m_win(wp, wp->w_topline, wp->w_cursor.lnum, FALSE)
> wp->w_height)
++wp->w_topline;
}
" Ctrl-D reveals filler lines below the last line in the buffer.
func Test_diff_eob_halfpage()
- 5new
+ new
call setline(1, ['']->repeat(10) + ['a'])
diffthis
- call assert_true(5, winheight(5))
- 5new
+ new
call setline(1, ['']->repeat(3) + ['a', 'b'])
diffthis
+ resize 5
wincmd j
- resize 7
- exe "norm! G\<C-D>"
- call assert_equal(6, line('w0'))
+ resize 5
+ norm G
+ call assert_equal(7, line('w0'))
+ exe "norm! \<C-D>"
+ call assert_equal(8, line('w0'))
%bwipe!
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 294,
/**/
293,
/**/