Fix copy-pasting of CJK fullwidth characters.

They are stored as two separate characters in the vtbuf, so copy-pasting
will cause them to be passed to terminal_input_char() twice. Extend
terminal_input_char() to explicitly discard characters with TF_CJK_RIGHT
set. This causes only the left part to generate input.
This commit is contained in:
Ed Schouten 2013-12-24 18:42:26 +00:00
parent 679659aded
commit a3da01fc76

View File

@ -249,7 +249,13 @@ terminal_input_char(struct terminal *tm, term_char_t c)
if (tp == NULL)
return;
/* Strip off any attributes. */
/*
* Strip off any attributes. Also ignore input of second part of
* CJK fullwidth characters, as we don't want to return these
* characters twice.
*/
if (TCHAR_FORMAT(c) & TF_CJK_RIGHT)
return;
c = TCHAR_CHARACTER(c);
tty_lock(tp);