From b4f6124da0f474fcaca5e4b00b6563705a2dd682 Mon Sep 17 00:00:00 2001 From: gunboy001 Date: Sat, 21 Dec 2019 23:08:24 +0100 Subject: [PATCH] rendered cursor moves the right amount of cells --- src/ste.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ste.c b/src/ste.c index 88d9dac..db691a1 100644 --- a/src/ste.c +++ b/src/ste.c @@ -493,7 +493,13 @@ void curUpdateRender () /* continue (skip increment) if you encounter a continuation char */ if (isCont(c)) continue; - else if (isStart(c)) t.cur.r_x++; + else if (isStart(c)) { + wchar_t tc; + mbtowc(&tc, + &rows.rw[t.cur.y].chars[i], + rows.rw[t.cur.y].size - i); + t.cur.r_x += wcwidth(tc) - 1; + } if (c == '\t') t.cur.r_x += (TABSIZE - 1);