win_update: fix redraw regression (#11027)

Before 6e9ea5adc `win_ins_lines` would return `FAIL` for `i/line_count == 0`.

Handle this by checking it in the outer `if`.

Ref: https://github.com/neovim/neovim/commit/6e9ea5ad#commitcomment-35084669
This commit is contained in:
Daniel Hahler
2019-09-18 18:22:38 +02:00
committed by GitHub
parent d478542110
commit 1070c092c7
2 changed files with 75 additions and 1 deletions

View File

@@ -871,7 +871,7 @@ static void win_update(win_T *wp)
if (wp->w_lines[0].wl_lnum != wp->w_topline)
i += diff_check_fill(wp, wp->w_lines[0].wl_lnum)
- wp->w_old_topfill;
if (i < wp->w_grid.Rows - 2) { // less than a screen off
if (i != 0 && i < wp->w_grid.Rows - 2) { // less than a screen off
// Try to insert the correct number of lines.
// If not the last window, delete the lines at the bottom.
// win_ins_lines may fail when the terminal can't do it.