revert: "refactor: Remove allow_keys global (#6346)"

This commit is contained in:
zeertzjq
2022-04-27 09:03:09 +08:00
parent d531ef6813
commit f6afc7c324
11 changed files with 42 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ int ask_yesno(const char *const str, const bool direct)
State = CONFIRM; // Mouse behaves like with :confirm.
setmouse(); // Disable mouse in xterm.
no_mapping++;
allow_keys++; // no mapping here, but recognize keys
int r = ' ';
while (r != 'y' && r != 'n') {
@@ -62,6 +63,7 @@ int ask_yesno(const char *const str, const bool direct)
State = save_State;
setmouse();
no_mapping--;
allow_keys--;
return r;
}
@@ -172,6 +174,7 @@ int get_number(int colon, int *mouse_used)
}
no_mapping++;
allow_keys++; // no mapping here, but recognize keys
for (;;) {
ui_cursor_goto(msg_row, msg_col);
c = safe_vgetc();
@@ -205,6 +208,7 @@ int get_number(int colon, int *mouse_used)
}
}
no_mapping--;
allow_keys--;
return n;
}