vim-patch:9.0.1597: cursor ends up below the window after a put (#23873)

Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes vim/vim#12465)

8509014add

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-06-02 08:48:49 +08:00
committed by GitHub
parent a0375b68c1
commit 9f3c4c1526
5 changed files with 55 additions and 5 deletions

View File

@@ -6511,6 +6511,10 @@ pos_T *var2fpos(const typval_T *const tv, const bool dollar_lnum, int *const ret
pos.coladd = 0;
if (name[0] == 'w' && dollar_lnum) {
// the "w_valid" flags are not reset when moving the cursor, but they
// do matter for update_topline() and validate_botline().
check_cursor_moved(curwin);
pos.col = 0;
if (name[1] == '0') { // "w0": first visible line
update_topline(curwin);