Ticket #3260: mcview hex edit: can't enter certain UTF-8 characters.

(mcview_handle_editkey): an is_printable() check was performed for every
byte of the UTF-8 which obviously doesn't make sense. This check
shouldn't be performed for 8-bit charsets either. If the given byte can
arrive as input, the file should be modified accordingly.
The TAB key shouldn't be accepted as literal, to allow moving back to
the hexview area.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Egmont Koblinger 2015-02-17 13:54:14 +03:00 committed by Andrew Borodin
parent c00c298b53
commit f0ab29b820

View File

@ -252,7 +252,7 @@ mcview_handle_editkey (mcview_t * view, int key)
else else
{ {
/* Text editing */ /* Text editing */
if (key < 256 && ((key == '\n') || is_printable (key))) if (key < 256 && key != '\t')
byte_val = key; byte_val = key;
else else
return MSG_NOT_HANDLED; return MSG_NOT_HANDLED;