# HG changeset patch # User Bram Moolenaar # Date 1626208205 -7200 # Node ID 5932642234e15464258240bf3f8c62267e20c30e # Parent 202f48dbc48a0f3b9df880486f83a6e9b774defd patch 8.2.3159: cursor displayed in wrong position after deleting line Commit: https://github.com/vim/vim/commit/5bea41dea34bcc73c4efb1b554ad0a2018966ecc Author: Bram Moolenaar Date: Tue Jul 13 22:21:44 2021 +0200 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 https://github.com/vim/vim/issues/8559) diff --git a/src/change.c b/src/change.c --- 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. diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3159, +/**/ 3158, /**/ 3157,