From 3564593563b2afe48aea1e8a58e2bcf7aacc4363 Mon Sep 17 00:00:00 2001 From: Bakkeby Date: Fri, 8 Mar 2024 19:52:11 +0100 Subject: [PATCH] Revert "Fix cursor move with wide glyphs" ref. #118 This reverts commit 400aa4492f28ac6556727aac225bba51decc82b5. --- st.c | 6 +----- st.h | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/st.c b/st.c index 652ee9a..30879f8 100644 --- a/st.c +++ b/st.c @@ -2811,16 +2811,12 @@ tstrsequence(uchar c) void tcontrolcode(uchar ascii) { - size_t i; - switch (ascii) { case '\t': /* HT */ tputtab(1); return; case '\b': /* BS */ - for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i) - ; - tmoveto(term.c.x - i, term.c.y); + tmoveto(term.c.x-1, term.c.y); return; case '\r': /* CR */ tmoveto(0, term.c.y); diff --git a/st.h b/st.h index 110f4aa..6c6ebd9 100644 --- a/st.h +++ b/st.h @@ -152,8 +152,8 @@ typedef struct { typedef struct { Glyph attr; /* current char attributes */ - int x; /* terminal column */ - int y; /* terminal row */ + int x; + int y; char state; } TCursor;