all repos — st @ 1cf8b77d2798a43c979b71e16fd45d63b808f569

st (suckless terminal) config

handle tabulation (still not perfect)
Aurélien Aptel aurelien.aptel@gmail.com
commit

1cf8b77d2798a43c979b71e16fd45d63b808f569

parent

0ecfcc39b07bb7cca6a688a743299e6ef990e122

2 files changed, 16 insertions(+), 0 deletions(-)

jump to
M st.cst.c

@@ -559,6 +559,17 @@ 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--) + tputc(' '); +} + +void tputc(char c) { static int inesc = 0;

@@ -574,6 +585,9 @@ default:

tsetchar(c); tcursor(CSright); break; + case '\t': + tputtab(); + break; case '\b': tcursor(CSleft); break;
M st.hst.h

@@ -66,6 +66,8 @@ enum { CRset=1 , CRupdate=2 }; /* Character state */

enum { TMwrap=1 , TMinsert=2 }; /* Terminal mode */ enum { SCupdate, SCredraw }; /* screen draw mode */ +typedef int Color; + typedef struct { char c; /* character code */ char mode; /* attribute flags */