termpty: skip combining chars unless it can be used as strikethrough

This commit is contained in:
Boris Faure 2016-11-26 18:42:26 +01:00
parent 786dd890cc
commit 6cc0abd787
2 changed files with 15 additions and 0 deletions

View File

@ -151,6 +151,7 @@ struct _Termpty
unsigned int no_autorepeat : 1;
unsigned int cjk_ambiguous_wide : 1;
unsigned int hide_cursor : 1;
unsigned int combining_strike : 1;
} termstate;
struct {
int cx, cy;

View File

@ -176,9 +176,23 @@ termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len)
{
continue;
}
if (EINA_UNLIKELY(g >= 0x300 && g <=0x36f))
{
/* combining chars */
if (EINA_UNLIKELY(g == 0x336))
{
ty->termstate.combining_strike = 1;
}
continue;
}
termpty_cell_codepoint_att_fill(ty, g, ty->termstate.att,
&(cells[ty->cursor_state.cx]), 1);
if (EINA_UNLIKELY(ty->termstate.combining_strike))
{
ty->termstate.combining_strike = 0;
cells[ty->cursor_state.cx].att.strike = 1;
}
cells[ty->cursor_state.cx].att.dblwidth = _termpty_is_dblwidth_get(ty, g);
if (EINA_UNLIKELY((cells[ty->cursor_state.cx].att.dblwidth) && (ty->cursor_state.cx < (ty->w - 1))))
{