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
master
David Lawrence Ramsey 2005-06-13 17:26:19 +00:00
parent 40c3cd1aa9
commit 399fe939f9
3 changed files with 12 additions and 21 deletions

View File

@ -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

View File

@ -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]);

View File

@ -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. */