in parse_verbatim_kbinput(), don't include the ability to enter a
Unicode sequence via verbatim input mode if we're not in a UTF-8 locale git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3588 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
a620e683e7
commit
5c7d88dc16
|
@ -315,7 +315,8 @@ CVS code -
|
|||
- Simplify the if blocks wherever possible. (DLR)
|
||||
parse_verbatim_kbinput()
|
||||
- Don't include the ability to enter a Unicode sequence via
|
||||
verbatim input mode if ENABLE_UTF8 isn't defined. (DLR)
|
||||
verbatim input mode if ENABLE_UTF8 isn't defined or we're not
|
||||
in a UTF-8 locale. (DLR)
|
||||
check_statusblank()
|
||||
- Avoid redundant updates when statusblank is 0. (DLR)
|
||||
display_string()
|
||||
|
|
23
src/winio.c
23
src/winio.c
|
@ -1449,27 +1449,26 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
|
|||
while ((kbinput = get_input(win, 1)) == NULL);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
if (using_utf8()) {
|
||||
/* Check whether the first keystroke is a valid hexadecimal
|
||||
* digit. */
|
||||
uni = get_unicode_kbinput(*kbinput);
|
||||
|
||||
/* If the first keystroke isn't a valid hexadecimal digit, put back
|
||||
* the first keystroke. */
|
||||
/* If the first keystroke isn't a valid hexadecimal digit, put
|
||||
* back the first keystroke. */
|
||||
if (uni != ERR)
|
||||
#endif /* ENABLE_UTF8 */
|
||||
|
||||
unget_input(kbinput, 1);
|
||||
|
||||
#ifdef ENABLE_UTF8
|
||||
/* Otherwise, read in keystrokes until we have a complete Unicode
|
||||
* sequence, and put back the corresponding Unicode value. */
|
||||
/* Otherwise, read in keystrokes until we have a complete
|
||||
* Unicode sequence, and put back the corresponding Unicode
|
||||
* value. */
|
||||
else {
|
||||
char *uni_mb;
|
||||
int uni_mb_len, *seq, i;
|
||||
|
||||
if (win == edit)
|
||||
/* TRANSLATORS: This is displayed during the input of a
|
||||
* six-digit Unicode code. */
|
||||
* six-digit hexadecimal Unicode character code. */
|
||||
statusbar(_("Unicode Input"));
|
||||
|
||||
while (uni == ERR) {
|
||||
|
@ -1478,7 +1477,8 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
|
|||
uni = get_unicode_kbinput(*kbinput);
|
||||
}
|
||||
|
||||
/* Put back the multibyte equivalent of the Unicode value. */
|
||||
/* Put back the multibyte equivalent of the Unicode
|
||||
* value. */
|
||||
uni_mb = make_mbchar(uni, &uni_mb_len);
|
||||
|
||||
seq = (int *)nmalloc(uni_mb_len * sizeof(int));
|
||||
|
@ -1491,7 +1491,10 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
|
|||
free(seq);
|
||||
free(uni_mb);
|
||||
}
|
||||
#endif /* ENABLE_UTF8 */
|
||||
} else
|
||||
#endif
|
||||
/* Put back the first keystroke. */
|
||||
unget_input(kbinput, 1);
|
||||
|
||||
/* Get the complete sequence, and save the characters in it as the
|
||||
* result. */
|
||||
|
|
Loading…
Reference in New Issue