aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2016-11-26 18:42:26 +0100
committerBoris Faure <billiob@gmail.com>2016-11-26 18:42:26 +0100
commit6cc0abd78770d79e19dd21cd893e31cf429aafca (patch)
tree30480fbce1321385fad568e9906572d5f57d9618
parenttermio: dont show full/relative for emails or protocols (diff)
downloadterminology-6cc0abd78770d79e19dd21cd893e31cf429aafca.tar.gz
termpty: skip combining chars unless it can be used as strikethrough
-rw-r--r--src/bin/termpty.h1
-rw-r--r--src/bin/termptyops.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 3573dbe..85413e5 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -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;
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 3d035f8..c7a1662 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -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))))
{