feat(api): win_viewport also sends line_count #15613

This commit is contained in:
Yatao Li
2021-09-11 10:19:39 +08:00
committed by GitHub
parent 09a477737f
commit 086631cd92
5 changed files with 65 additions and 59 deletions

View File

@@ -840,14 +840,15 @@ void ui_ext_win_viewport(win_T *wp)
{
if ((wp == curwin || ui_has(kUIMultigrid)) && wp->w_viewport_invalid) {
int botline = wp->w_botline;
if (botline == wp->w_buffer->b_ml.ml_line_count+1
&& wp->w_empty_rows == 0) {
int line_count = wp->w_buffer->b_ml.ml_line_count;
if (botline == line_count+1 && wp->w_empty_rows == 0) {
// TODO(bfredl): The might be more cases to consider, like how does this
// interact with incomplete final line? Diff filler lines?
botline = wp->w_buffer->b_ml.ml_line_count;
}
ui_call_win_viewport(wp->w_grid_alloc.handle, wp->handle, wp->w_topline-1,
botline, wp->w_cursor.lnum-1, wp->w_cursor.col);
botline, wp->w_cursor.lnum-1, wp->w_cursor.col,
line_count);
wp->w_viewport_invalid = false;
}
}