Fix: get_count and altmeta

M-<key> shortcuts with altmeta enabled weren't working when preceded by
a count (e.g. 2 M-j for "jump twice"): g.program_state.getting_a_command
determined whether <esc> should be read as staring a potential meta key
combination, and was being reset by readchar on the first digit entered
without being reactivated for subsequent input.  As a result, by the
time the player entered the actual command to be modified by the count,
readchar wasn't bothering to look for M-<key> sequences.
This commit is contained in:
Michael Meyer
2022-08-04 13:34:06 -04:00
committed by Pasi Kallinen
parent 83f8ec1c43
commit 76d9d65884

View File

@@ -5805,8 +5805,11 @@ get_count(
if (inkey) {
key = inkey;
inkey = '\0';
} else
} else {
g.program_state.getting_a_command = 1; /* readchar altmeta
* compatibility */
key = readchar();
}
if (digit(key)) {
cnt = 10L * cnt + (long) (key - '0');