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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user