X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=c24bb1d009575db1e193c5c8a089d4fd130d5d13;hb=059d2ba264f8ee2f6fbdb4d7199b611433ad8a72;hp=2318435a4dd7302482bc0e9ffcb5d585898b7588;hpb=86fa756033e9072a4b114a50896baff36b804ce4;p=st.git diff --git a/st.c b/st.c index 2318435..c24bb1d 100644 --- a/st.c +++ b/st.c @@ -364,21 +364,6 @@ void tsetattr(int *attr, int l) { int i; -#ifdef TRUECOLOR /* ESC [ ? ; ; ; m */ - Color col; - if(escseq.priv && escseq.len == 4) { /* True color extension :) */ - col = (escseq.arg[1]<<16) + (escseq.arg[2]<<8) + escseq.arg[3]; - switch(escseq.arg[0]) { - case 3: /* foreground */ - term.c.attr.fg = col; - break; - case 4: /* background */ - term.c.attr.bg = col; - break; - } - } - else -#endif for(i = 0; i < l; i++) { switch(attr[i]) { case 0: @@ -573,6 +558,17 @@ escreset(void) { memset(&escseq, 0, sizeof(escseq)); } +void +tputtab(void) { + int space = TAB - term.c.x % TAB; + + if(term.c.x + space >= term.col) + space--; + + for(; space > 0; space--) + tcursor(CSright); +} + void tputc(char c) { static int inesc = 0; @@ -589,6 +585,9 @@ tputc(char c) { tsetchar(c); tcursor(CSright); break; + case '\t': + tputtab(); + break; case '\b': tcursor(CSleft); break;