From 1cf8b77d2798a43c979b71e16fd45d63b808f569 Mon Sep 17 00:00:00 2001 From: Aurélien Aptel Date: Thu, 14 May 2009 01:03:17 +0200 Subject: handle tabulation (still not perfect) --- st.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'st.c') diff --git a/st.c b/st.c index ef0fd17..79fb161 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--) + tputc(' '); +} + 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; -- cgit v1.2.3-13-gbd6f