0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.1147: :confirm may happen in cooked mode

Problem:    :confirm may happen in cooked mode. (Jason Franklin)
Solution:   Switch to raw mode before prompting. (Brandon Pfeifer)
This commit is contained in:
Bram Moolenaar
2020-07-06 21:24:57 +02:00
parent ab58946384
commit 27321dbeed
3 changed files with 93 additions and 35 deletions

View File

@@ -3652,6 +3652,7 @@ do_dialog(
char_u *hotkeys;
int c;
int i;
tmode_T save_tmode;
#ifndef NO_CONSOLE
// Don't output anything in silent mode ("ex -s")
@@ -3683,6 +3684,10 @@ do_dialog(
State = CONFIRM;
setmouse();
// Ensure raw mode here.
save_tmode = cur_tmode;
settmode(TMODE_RAW);
/*
* Since we wait for a keypress, don't make the
* user press RETURN as well afterwards.
@@ -3743,6 +3748,7 @@ do_dialog(
vim_free(hotkeys);
}
settmode(save_tmode);
State = oldState;
setmouse();
--no_wait_return;