0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.2.1939: invalid memory access in Ex mode with global command

Problem:    Invalid memory access in Ex mode with global command.
Solution:   Make sure the cursor is on a valid line. (closes #7238)
This commit is contained in:
Bram Moolenaar
2020-11-01 21:56:40 +01:00
parent a46765a797
commit 3b6d57f2ce
3 changed files with 28 additions and 0 deletions

View File

@@ -196,6 +196,7 @@ update_topline(void)
// the cursor line.
if (!screen_valid(TRUE) || curwin->w_height == 0)
{
check_cursor_lnum();
curwin->w_topline = curwin->w_cursor.lnum;
curwin->w_botline = curwin->w_topline;
curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;