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)
diff --git a/src/change.c b/src/change.c
index 248e6d8..73ea64f 100644
--- a/src/change.c
+++ b/src/change.c
@@ -563,9 +563,12 @@
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.