diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2024-03-30 12:30:49 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2024-03-30 12:37:06 +0100 |
commit | 8c68ec52419f3f965164cafcf589b87e8961348d (patch) | |
tree | 9ce5f2d0432e0fddeeb527e672a3620590186469 | |
parent | 5ce971628106fb767ef91bf4386227423f5fdf98 (diff) | |
download | st-8c68ec52419f3f965164cafcf589b87e8961348d.tar.gz st-8c68ec52419f3f965164cafcf589b87e8961348d.tar.bz2 st-8c68ec52419f3f965164cafcf589b87e8961348d.zip |
Revert "Fix cursor move with wide glyphs"
This reverts commit 7473a8d1a57e5f9aba41b953f4e498c35e1c9dc5.
This patch needs some more work. It caused regressions with programs that use
GNU readline, etc.
Original test-case example from Tim Culverhouse <tim@timculverhouse.com>:
printf " đ" && sleep 2 && printf "\e[D" && sleep 2 && printf "\e[D" && sleep 2
After the patch it caused regressions, example test-case:
printf "Ać\bB\n"
-rw-r--r-- | st.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -86,8 +86,8 @@ enum escape_state { typedef struct { Glyph attr; /* current char attributes */ - int x; /* terminal column */ - int y; /* terminal row */ + int x; + int y; char state; } TCursor; @@ -2175,16 +2175,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); |