aboutsummaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2009-05-14 01:03:17 +0200
committerAurélien Aptel <aurelien.aptel@gmail.com>2009-05-14 01:03:17 +0200
commit1cf8b77d2798a43c979b71e16fd45d63b808f569 (patch)
treebe28de4081f44d4e6e266122bd1362c8adb4fd24 /st.c
parent0ecfcc39b07bb7cca6a688a743299e6ef990e122 (diff)
downloadst-1cf8b77d2798a43c979b71e16fd45d63b808f569.tar.gz
handle tabulation (still not perfect)
Diffstat (limited to 'st.c')
-rw-r--r--st.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/st.c b/st.c
index ef0fd17..79fb161 100644
--- a/st.c
+++ b/st.c
@@ -559,6 +559,17 @@ escreset(void) {
}
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;
remember that computers suck.