summaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorJaehwang Jung <tomtomjhj@gmail.com>2024-04-26 18:48:48 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-26 18:48:48 +0200
commiteb80b8304efb6dfeaa8d01dd41fe281df4894240 (patch)
treeb990d2df9fddb8194bfe49e9205005a0d952bc1f /src/window.c
parent4b9fc8247aede14a440cfe5da58a466b3af04720 (diff)
patch 9.1.0374: wrong botline in BufEnterv9.1.0374
Problem: When :edit an existing buffer, line('w$') may return a wrong result. Solution: Reset w_valid in curwin_init() (Jaehwang Jung) `do_ecmd()` reinitializes the current window (`curwin_init()`) whose `w_valid` field may have `VALID_BOTLINE` set. Resetting `w_botline` without marking it as invalid makes subsequent `validate_botline()` calls a no-op, thus resulting in wrong `line('w$')` value. closes: #14642 Signed-off-by: Jaehwang Jung <tomtomjhj@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 7d78b5f29a..73229059ea 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2475,6 +2475,7 @@ win_init_empty(win_T *wp)
wp->w_topfill = 0;
#endif
wp->w_botline = 2;
+ wp->w_valid = 0;
#if defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
wp->w_s = &wp->w_buffer->b_s;
#endif