1
0
forked from aniani/vim

patch 9.0.1597: cursor ends up below the window after a put

Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes #12465)
This commit is contained in:
Bram Moolenaar
2023-06-01 19:27:08 +01:00
parent eb43b7f053
commit 8509014add
6 changed files with 39 additions and 2 deletions

View File

@@ -715,19 +715,21 @@ set_topline(win_T *wp, linenr_T lnum)
/*
* Call this function when the length of the cursor line (in screen
* characters) has changed, and the change is before the cursor.
* If the line length changed the number of screen lines might change,
* requiring updating w_topline. That may also invalidate w_crow.
* Need to take care of w_botline separately!
*/
void
changed_cline_bef_curs(void)
{
curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
|VALID_CHEIGHT|VALID_TOPLINE);
}
void
changed_cline_bef_curs_win(win_T *wp)
{
wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
|VALID_CHEIGHT|VALID_TOPLINE);
}