diff --git a/ChangeLog b/ChangeLog index 8de5249ed87bcb4c417f29f2d83c9537c77cb053..8da44a9772c2cc8b92695f027c15aaf2ec8875b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,11 @@ CVS code - and NANO_APPEND_KEY are. Changes to shortcut_init(), usage(), main(), search_init(), nanorc.sample, nano.1, nanorc.5, nano.texi, etc. (DLR) +- chars.c: + make_mbstring() + - Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a + compilation problem when --enable-nanorc isn't used and + --enable-extra is. (DLR) - cut.c: cut_line() - Set placewewant properly after cutting a line, to avoid a @@ -178,6 +183,11 @@ CVS code - total_update() - Simplify to call clearok(TRUE) and wrefresh() on edit, which updates the entire screen in fewer function calls. (DLR) + do_credits() + - Save the keystroke that breaks us out of the credits (if any) + and put it back so that it isn't lost. This is especially + needed if the keystroke is part of a multibyte character. + (DLR) - configure.ac: - Minor tweaks to some of the test blocks to avoid XSI:isms. (DLR, adapted from a Debian patch for GNU ed by David diff --git a/src/chars.c b/src/chars.c index f46c5df4e54928ed2f2895a1377082f0aa4d8961..549ea0da6baea8d1536a20242a26f6b8d11b5d72 100644 --- a/src/chars.c +++ b/src/chars.c @@ -301,7 +301,7 @@ char *make_mbchar(int chr, int *chr_mb_len) return chr_mb; } -#if defined(ENABLE_NANORC) || defined(ENABLE_EXTRA) +#if defined(ENABLE_NANORC) || defined(NANO_EXTRA) /* Convert the string str to a valid multibyte string with the same wide * character values as str. Return the (dynamically allocated) * multibyte string. */ diff --git a/src/winio.c b/src/winio.c index 4875f5fa8a71c266ce674a854cd8846950fc1871..a792eef55dc169a992e2a067fc99b415591610cc 100644 --- a/src/winio.c +++ b/src/winio.c @@ -4020,7 +4020,7 @@ void dump_buffer_reverse(void) /* Easter egg: Display credits. Assume nodelay(edit) is FALSE. */ void do_credits(void) { - int crpos = 0, xlpos = 0; + int kbinput = ERR, crpos = 0, xlpos = 0; const char *credits[CREDIT_LEN] = { NULL, /* "The nano text editor" */ NULL, /* "version" */ @@ -4101,7 +4101,7 @@ void do_credits(void) wrefresh(bottomwin); for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) { - if (wgetch(edit) != ERR) + if ((kbinput = wgetch(edit)) != ERR) break; if (crpos < CREDIT_LEN) { @@ -4129,16 +4129,19 @@ void do_credits(void) napms(700); scroll(edit); wrefresh(edit); - if (wgetch(edit) != ERR) + if ((kbinput = wgetch(edit)) != ERR) break; napms(700); scroll(edit); wrefresh(edit); } + if (kbinput != ERR) + ungetch(kbinput); + + curs_set(1); scrollok(edit, FALSE); nodelay(edit, FALSE); - curs_set(1); total_refresh(); } #endif