diff options
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2100,15 +2100,19 @@ tputc(char *c, int len) { | |||
2100 | sel.bx = -1; | 2100 | sel.bx = -1; |
2101 | if(IS_SET(MODE_WRAP) && term.c.state & CURSOR_WRAPNEXT) | 2101 | if(IS_SET(MODE_WRAP) && term.c.state & CURSOR_WRAPNEXT) |
2102 | tnewline(1); /* always go to first col */ | 2102 | tnewline(1); /* always go to first col */ |
2103 | if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col) | 2103 | |
2104 | if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col) { | ||
2104 | memmove(&term.line[term.c.y][term.c.x+1], | 2105 | memmove(&term.line[term.c.y][term.c.x+1], |
2105 | &term.line[term.c.y][term.c.x], | 2106 | &term.line[term.c.y][term.c.x], |
2106 | (term.col - term.c.x - 1) * sizeof(Glyph)); | 2107 | (term.col - term.c.x - 1) * sizeof(Glyph)); |
2108 | } | ||
2109 | |||
2107 | tsetchar(c, &term.c.attr, term.c.x, term.c.y); | 2110 | tsetchar(c, &term.c.attr, term.c.x, term.c.y); |
2108 | if(term.c.x+1 < term.col) | 2111 | if(term.c.x+1 < term.col) { |
2109 | tmoveto(term.c.x+1, term.c.y); | 2112 | tmoveto(term.c.x+1, term.c.y); |
2110 | else | 2113 | } else { |
2111 | term.c.state |= CURSOR_WRAPNEXT; | 2114 | term.c.state |= CURSOR_WRAPNEXT; |
2115 | } | ||
2112 | } | 2116 | } |
2113 | 2117 | ||
2114 | int | 2118 | int |