summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 3f171ad..0866310 100644
--- a/main.c
+++ b/main.c
@@ -191,6 +191,9 @@ void draw(void *ctx) {
if (c == '\n') {
x = 0;
y++;
+ } else if (c == '\t') {
+ x++;
+ x += (-x & 7);
} else if (c) {
vui_chr(x++, y, c);
}
@@ -274,7 +277,7 @@ int main(int argc, const char **argv) {
cur = txt_insert_c(&txt, cur, '\n');
break;
default:
- if (c >= ' ' && c <= KEY_UTF8_MAX) cur = txt_insert_c(&txt, cur, c);
+ if ((c == '\t' || c >= ' ') && c <= KEY_UTF8_MAX) cur = txt_insert_c(&txt, cur, c);
break;
}
}