vim-patch:8.1.1509: cmdline_row can become negative, causing a crash

Problem:    Cmdline_row can become negative, causing a crash.
Solution:   Make sure cmdline_row does not become negagive. (closes vim/vim#4102)
954bb06363
This commit is contained in:
Jan Edmund Lazo 2019-06-09 16:12:04 -04:00
parent 1ce28d7d9b
commit aecbbb0b11

View File

@ -2508,9 +2508,10 @@ int prompt_for_number(int *mouse_used)
i = get_number(TRUE, mouse_used);
if (KeyTyped) {
/* don't call wait_return() now */
/* msg_putchar('\n'); */
cmdline_row = msg_row - 1;
// don't call wait_return() now
if (msg_row > 0) {
cmdline_row = msg_row - 1;
}
need_wait_return = FALSE;
msg_didany = FALSE;
msg_didout = FALSE;