From 1ce3eaa7b1ce296f2e95e832f12a74f4af252b58 Mon Sep 17 00:00:00 2001 From: Brian Barto Date: Mon, 11 Apr 2016 16:31:32 -0400 Subject: [PATCH] Handling for tab characters modified: src/nms.c --- src/nms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nms.c b/src/nms.c index f3559a0..2ada94a 100644 --- a/src/nms.c +++ b/src/nms.c @@ -9,6 +9,7 @@ #define SPACE 32 #define NEWLINE 10 +#define TAB 9 #define KNRM "\x1B[0m" #define KMAG "\x1B[35m" @@ -47,6 +48,8 @@ int main(void) { if (c == NEWLINE) { ++y; x = 1; + } else if (c == TAB && x + 4 <= termSizeCols) { + x += 4; } else if (isspace(c)) { if (++x > termSizeCols) { ++y;