X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=04ff1b94038ad4cb846132adaa9cb99482bbfac9;hb=44226483fb0a3d6270970399d8a91abb2d16146b;hp=f8d2257a270e09aac49c45083e08ef62cd06c26d;hpb=ce3f4fc647be3ab28f934db9365445a56ebd85bf;p=st.git diff --git a/st.c b/st.c index f8d2257..04ff1b9 100644 --- a/st.c +++ b/st.c @@ -136,6 +136,7 @@ static void tinsertblankline(int); static void tmoveto(int, int); static void tnew(int, int); static void tnewline(void); +static void tputtab(void); static void tputc(char); static void tputs(char*, int); static void treset(void); @@ -152,6 +153,9 @@ static void ttyread(void); static void ttyresize(int, int); static void ttywrite(const char *, size_t); +static void xbell(void); +static void xdraws(char *, Glyph, int, int, int); +static void xhints(void); static void xclear(int, int, int, int); static void xcursor(int); static void xinit(void); @@ -443,11 +447,6 @@ tmovecursor(int dir) { break; case CURSOR_LEFT: xf--; - if(term.mode & MODE_WRAP && xf < 0) { - xf = term.col-1, yf--; - if(yf < term.top) - yf = term.top, xf = 0; - } break; case CURSOR_RIGHT: xf++; @@ -497,21 +496,21 @@ tdeletechar(int n) { return; } memmove(&term.line[term.c.y][dst], &term.line[term.c.y][src], size * sizeof(Glyph)); - tclearregion(term.col-size, term.c.y, term.col-1, term.c.y); + tclearregion(term.col-n, term.c.y, term.col-1, term.c.y); } void tinsertblank(int n) { int src = term.c.x; int dst = src + n; - int size = term.col - n - src; + int size = term.col - dst; if(dst >= term.col) { tclearregion(term.c.x, term.c.y, term.col-1, term.c.y); return; } memmove(&term.line[term.c.y][dst], &term.line[term.c.y][src], size * sizeof(Glyph)); - tclearregion(src, term.c.y, dst, term.c.y); + tclearregion(src, term.c.y, dst - 1, term.c.y); } void @@ -1173,7 +1172,7 @@ xcursor(int mode) { if(term.line[term.c.y][term.c.x].state & GLYPH_SET) g.c = term.line[term.c.y][term.c.x].c; - + /* remove the old cursor */ if(term.line[oldy][oldx].state & GLYPH_SET) xdraws(&term.line[oldy][oldx].c, term.line[oldy][oldx], oldx, oldy, 1);