aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/st.c b/st.c
index bd0c59e..548e0c2 100644
--- a/st.c
+++ b/st.c
@@ -2445,6 +2445,7 @@ tputc(char *c, int len) {
2445 bool control; 2445 bool control;
2446 long unicodep; 2446 long unicodep;
2447 int width; 2447 int width;
2448 Glyph *gp;
2448 2449
2449 if(len == 1) { 2450 if(len == 1) {
2450 width = 1; 2451 width = 1;
@@ -2607,16 +2608,15 @@ tputc(char *c, int len) {
2607 return; 2608 return;
2608 if(sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y)) 2609 if(sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y))
2609 selclear(NULL); 2610 selclear(NULL);
2611
2612 gp = &term.line[term.c.y][term.c.x];
2610 if(IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) { 2613 if(IS_SET(MODE_WRAP) && (term.c.state & CURSOR_WRAPNEXT)) {
2611 term.line[term.c.y][term.c.x].mode |= ATTR_WRAP; 2614 gp->mode |= ATTR_WRAP;
2612 tnewline(1); 2615 tnewline(1);
2613 } 2616 }
2614 2617
2615 if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col) { 2618 if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col)
2616 memmove(&term.line[term.c.y][term.c.x+1], 2619 memmove(gp+1, gp, (term.col - term.c.x - 1) * sizeof(Glyph));
2617 &term.line[term.c.y][term.c.x],
2618 (term.col - term.c.x - 1) * sizeof(Glyph));
2619 }
2620 2620
2621 if(term.c.x+width > term.col) 2621 if(term.c.x+width > term.col)
2622 tnewline(1); 2622 tnewline(1);
@@ -2624,10 +2624,10 @@ tputc(char *c, int len) {
2624 tsetchar(c, &term.c.attr, term.c.x, term.c.y); 2624 tsetchar(c, &term.c.attr, term.c.x, term.c.y);
2625 2625
2626 if(width == 2) { 2626 if(width == 2) {
2627 term.line[term.c.y][term.c.x].mode |= ATTR_WIDE; 2627 gp->mode |= ATTR_WIDE;
2628 if(term.c.x+1 < term.col) { 2628 if(term.c.x+1 < term.col) {
2629 term.line[term.c.y][term.c.x+1].c[0] = '\0'; 2629 gp[1].c[0] = '\0';
2630 term.line[term.c.y][term.c.x+1].mode = ATTR_WDUMMY; 2630 gp[1].mode = ATTR_WDUMMY;
2631 } 2631 }
2632 } 2632 }
2633 if(term.c.x+width < term.col) { 2633 if(term.c.x+width < term.col) {