X-Git-Url: https://jasonwoof.com/gitweb/?p=st.git;a=blobdiff_plain;f=st.c;h=e468d73cf522853325cc0c26921e91d0cf3bad05;hp=263abaa50406b11f350de910bb39f4a944115638;hb=6b7f63bac597ca03e18fe63ad522b4d1bded08d1;hpb=80b32af794b659cb15745cfb2a19fce0829c42c7 diff --git a/st.c b/st.c index 263abaa..e468d73 100644 --- a/st.c +++ b/st.c @@ -1587,30 +1587,32 @@ tclearregion(int x1, int y1, int x2, int y2) { void tdeletechar(int n) { int dst, src, size; + Glyph *line; LIMIT(n, 0, term.col - term.c.x); dst = term.c.x; src = term.c.x + n; size = term.col - src; + line = term.line[term.c.y]; - memmove(&term.line[term.c.y][dst], &term.line[term.c.y][src], - size * sizeof(Glyph)); + memmove(&line[dst], &line[src], size * sizeof(Glyph)); tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); } void tinsertblank(int n) { int dst, src, size; + Glyph *line; LIMIT(n, 0, term.col - term.c.x); dst = term.c.x + n; src = term.c.x; size = term.col - dst; + line = term.line[term.c.y]; - memmove(&term.line[term.c.y][dst], &term.line[term.c.y][src], - size * sizeof(Glyph)); + memmove(&line[dst], &line[src], size * sizeof(Glyph)); tclearregion(src, term.c.y, dst - 1, term.c.y); }