revert the changes to the behavior of Esc Esc [3-digit number from 000

to 255], as it still won't let us type all possible bytes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2663 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-06-14 23:38:08 +00:00
parent bdfa927d62
commit ce9d299c47
3 changed files with 21 additions and 12 deletions

View File

@ -69,13 +69,6 @@ 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

View File

@ -419,9 +419,10 @@ 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 byte with the corresponding value. The following "
"keystrokes are available in the main editor window. "
"Alternative keys are shown in parentheses:\n\n");
"the character 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]);

View File

@ -550,6 +550,9 @@ 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
@ -557,8 +560,20 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
byte_digits = 0;
escapes = 0;
/* Put back the byte value. */
unget_input(&byte, 1);
/* 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(byte_mb);
free(seq);
}
} else {
/* Reset the escape counter. */