forked from aniani/vim
patch 9.1.0294: Text height function does not respect it's argument
Problem: plines_m_win() does not take into account it's "limit_winheight" argument for filler lines below the last line of the buffer. (after v9.1.0280) Solution: Check window height when "limit_winheight" is TRUE. (Luuk van Baal) closes: #14449 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
41208884b8
commit
08b0f632c1
15
src/misc1.c
15
src/misc1.c
@@ -502,7 +502,7 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
while (first <= last)
|
||||
while (first <= last && (!limit_winheight || count < wp->w_height))
|
||||
{
|
||||
#ifdef FEAT_FOLDING
|
||||
int x;
|
||||
@@ -519,17 +519,20 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight)
|
||||
#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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user