From 399fe939f9ad8b090e8ceb3a98a280c1f3a8b062 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Mon, 13 Jun 2005 17:26:19 +0000 Subject: [PATCH] change the behavior of Esc Esc [3-digit number from 000 to 255] so that it enters the byte with that value regardless of whether we're in UTF-8 mode or not, and update the help text to mention this; this will allow searching for and replacing raw bytes with their equivalent multibyte sequences as entered using verbatim input git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2653 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 7 +++++++ src/nano.c | 7 +++---- src/winio.c | 19 ++----------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d441689..8477f9da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -66,6 +66,13 @@ CVS code - make_valid_mbstring()), mbstrncasecmp(), mbstrcasestr(), mbrevstrcasestr(), etc.; removal of is_alnum_char() and is_alnum_wchar(). (DLR) + - Change the behavior of Esc Esc [3-digit number from 000 to + 255] so that it enters the byte with that value regardless of + whether we're in UTF-8 mode or not, and update the help text + to mention this. This will allow searching for and replacing + raw bytes with their equivalent multibyte sequences as entered + using verbatim input. Changes to help_init() and + parse_kbinput(). (DLR) - Implement word count via Meta-D at the main window. Note that this is disabled when NANO_SMALL is defined. New functions do_word_count() and do_next_word_void(); changes to diff --git a/src/nano.c b/src/nano.c index c5cd9a64..bf8e81a3 100644 --- a/src/nano.c +++ b/src/nano.c @@ -419,10 +419,9 @@ void help_init(void) "or Meta key depending on your keyboard setup. "); htx[2] = N_("Also, pressing Esc twice and then typing a " "three-digit decimal number from 000 to 255 will enter " - "the character with the corresponding value. The " - "following keystrokes are available in the main editor " - "window. Alternative keys are shown in " - "parentheses:\n\n"); + "the byte with the corresponding value. The following " + "keystrokes are available in the main editor window. " + "Alternative keys are shown in parentheses:\n\n"); } htx[0] = _(htx[0]); diff --git a/src/winio.c b/src/winio.c index c7e39726..b3949263 100644 --- a/src/winio.c +++ b/src/winio.c @@ -550,9 +550,6 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key ); if (byte != ERR) { - char *byte_mb; - int byte_mb_len, *seq, i; - /* If we've read in a complete byte * sequence, reset the byte sequence counter * and the escape counter, and put back the @@ -560,20 +557,8 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key byte_digits = 0; escapes = 0; - /* Put back the multibyte equivalent of the - * byte value. */ - byte_mb = make_mbchar(byte, &byte_mb_len); - - seq = (int *)nmalloc(byte_mb_len * - sizeof(int)); - - for (i = 0; i < byte_mb_len; i++) - seq[i] = (unsigned char)byte_mb[i]; - - unget_input(seq, byte_mb_len); - - free(seq); - free(byte_mb); + /* Put back the byte value. */ + unget_input(&byte, 1); } } else { /* Reset the escape counter. */ -- 2.39.5