From c5268d799fa6fb3468d9c0f06788c806458b5798 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 5 May 2019 12:17:10 +0000 Subject: [PATCH] Fix tab handling --- shape/shape.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shape/shape.py b/shape/shape.py index 5139287..cb34e77 100644 --- a/shape/shape.py +++ b/shape/shape.py @@ -65,6 +65,12 @@ class Shaper: if char == "\n": x = 0 y += 1 + elif char == "\t": + image.putpixel((x, y), bgcolor) + x += 1 + while x % self.args.tabwidth != 0: + image.putpixel((x, y), bgcolor) + x += 1 elif char.isspace(): image.putpixel((x, y), bgcolor) x += 1