From 0e484c2041f9196f61c2b5dfaed38e81d068680d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 2 Oct 2024 06:55:43 +0800 Subject: vim-patch:9.1.0753: Wrong display when typing in diff mode with 'smoothscroll' (#30614) Problem: Wrong display when typing in diff mode with 'smoothscroll'. Solution: Use adjust_plines_for_skipcol() (zeertzjq). closes: vim/vim#15776 https://github.com/vim/vim/commit/47f8584a80006cd25e7dc6fa7fb1bfe2e768403c --- src/nvim/drawscreen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index 025d8fe721..aa5c66465b 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -1805,8 +1805,10 @@ static void win_update(win_T *wp) // Correct the first entry for filler lines at the top // when it won't get updated below. if (win_may_fill(wp) && bot_start > 0) { - wp->w_lines[0].wl_size = (uint16_t)(plines_win_nofill(wp, wp->w_topline, true) - + wp->w_topfill); + int n = plines_win_nofill(wp, wp->w_topline, false) + wp->w_topfill + - adjust_plines_for_skipcol(wp); + n = MIN(n, wp->w_height_inner); + wp->w_lines[0].wl_size = (uint16_t)n; } } } -- cgit