X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=c24bb1d009575db1e193c5c8a089d4fd130d5d13;hb=059d2ba264f8ee2f6fbdb4d7199b611433ad8a72;hp=ef0fd17d00eaa7ea057fb7bb88093b4ed937f9a6;hpb=0ecfcc39b07bb7cca6a688a743299e6ef990e122;p=st.git diff --git a/st.c b/st.c index ef0fd17..c24bb1d 100644 --- a/st.c +++ b/st.c @@ -558,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; @@ -574,6 +585,9 @@ tputc(char c) { tsetchar(c); tcursor(CSright); break; + case '\t': + tputtab(); + break; case '\b': tcursor(CSleft); break;