mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
vim-patch:9.1.0374: wrong botline in BufEnter (#28530)
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: vim/vim#14642
eb80b8304e
Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
This commit is contained in:
@ -2467,6 +2467,7 @@ void win_init_empty(win_T *wp)
|
||||
wp->w_topline = 1;
|
||||
wp->w_topfill = 0;
|
||||
wp->w_botline = 2;
|
||||
wp->w_valid = 0;
|
||||
wp->w_s = &wp->w_buffer->b_s;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user