diff --git a/st.c b/st.c index c15ca4b..c289072 100644 --- a/st.c +++ b/st.c @@ -1219,8 +1219,10 @@ tsetchar(Rune u, const Glyph *attr, int x, int y) term.line[y][x+1].mode &= ~ATTR_WDUMMY; } } else if (term.line[y][x].mode & ATTR_WDUMMY) { - term.line[y][x-1].u = ' '; - term.line[y][x-1].mode &= ~ATTR_WIDE; + if (x > 0) { + term.line[y][x-1].u = ' '; + term.line[y][x-1].mode &= ~ATTR_WIDE; + } } term.dirty[y] = 1; @@ -2687,9 +2689,9 @@ draw(void) /* adjust cursor position */ LIMIT(term.ocx, 0, term.col-1); LIMIT(term.ocy, 0, term.row-1); - if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY) + if (term.ocx > 0 && (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY)) term.ocx--; - if (term.line[term.c.y][cx].mode & ATTR_WDUMMY) + if (cx > 0 && (term.line[term.c.y][cx].mode & ATTR_WDUMMY)) cx--; drawregion(0, 0, term.col, term.row);