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 | bump version to 0.9.1 (diff) | |
| download | st-8c68ec52419f3f965164cafcf589b87e8961348d.tar.gz 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 { | |||
| 86 | 86 | ||
| 87 | typedef struct { | 87 | typedef struct { |
| 88 | Glyph attr; /* current char attributes */ | 88 | Glyph attr; /* current char attributes */ |
| 89 | int x; /* terminal column */ | 89 | int x; |
| 90 | int y; /* terminal row */ | 90 | int y; |
| 91 | char state; | 91 | char state; |
| 92 | } TCursor; | 92 | } TCursor; |
| 93 | 93 | ||
| @@ -2175,16 +2175,12 @@ tstrsequence(uchar c) | |||
| 2175 | void | 2175 | void |
| 2176 | tcontrolcode(uchar ascii) | 2176 | tcontrolcode(uchar ascii) |
| 2177 | { | 2177 | { |
| 2178 | size_t i; | ||
| 2179 | |||
| 2180 | switch (ascii) { | 2178 | switch (ascii) { |
| 2181 | case '\t': /* HT */ | 2179 | case '\t': /* HT */ |
| 2182 | tputtab(1); | 2180 | tputtab(1); |
| 2183 | return; | 2181 | return; |
| 2184 | case '\b': /* BS */ | 2182 | case '\b': /* BS */ |
| 2185 | for (i = 1; term.c.x && term.line[term.c.y][term.c.x - i].u == 0; ++i) | 2183 | tmoveto(term.c.x-1, term.c.y); |
| 2186 | ; | ||
| 2187 | tmoveto(term.c.x - i, term.c.y); | ||
| 2188 | return; | 2184 | return; |
| 2189 | case '\r': /* CR */ | 2185 | case '\r': /* CR */ |
| 2190 | tmoveto(0, term.c.y); | 2186 | tmoveto(0, term.c.y); |
