input: store key codes in the macro buffer as they come in from ncurses

Otherwise the leading ESC of keystrokes like M-A does not get recorded.

This reverts commit 191cf671 from three weeks ago.

This fixes https://savannah.gnu.org/bugs/?65507.
This commit is contained in:
Benno Schulenberg 2024-03-22 16:04:21 +01:00
parent c2b4c2ae0e
commit 9ae84071eb

View File

@ -290,6 +290,10 @@ void read_keys_from(WINDOW *frame)
napms(20);
while (TRUE) {
#ifndef NANO_TINY
if (recording)
add_to_macrobuffer(input);
#endif
input = wgetch(frame);
/* If there aren't any more characters, stop reading. */
@ -1369,11 +1373,6 @@ int get_kbinput(WINDOW *frame, bool showcursor)
while (kbinput == ERR)
kbinput = parse_kbinput(frame);
#ifndef NANO_TINY
if (recording)
add_to_macrobuffer(kbinput);
#endif
/* If we read from the edit window, blank the status bar when it's time. */
if (frame == midwin)
blank_it_when_expired();