From 5bea41dea34bcc73c4efb1b554ad0a2018966ecc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 13 Jul 2021 22:21:44 +0200 Subject: patch 8.2.3159: cursor displayed in wrong position after deleting line Problem: Cursor displayed in wrong position after deleting line. Solution: When deleting lines do not approximate botline. (fixes #8559) --- src/change.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/change.c') diff --git a/src/change.c b/src/change.c index 248e6d848..73ea64ff1 100644 --- a/src/change.c +++ b/src/change.c @@ -563,9 +563,12 @@ changed_common( changed_cline_bef_curs_win(wp); if (wp->w_botline >= lnum) { - // Assume that botline doesn't change (inserted lines make - // other lines scroll down below botline). - approximate_botline_win(wp); + if (xtra < 0) + invalidate_botline_win(wp); + else + // Assume that botline doesn't change (inserted lines make + // other lines scroll down below botline). + approximate_botline_win(wp); } // Check if any w_lines[] entries have become invalid. -- cgit v1.2.1