From e6e09510292e87bc1c40a64a9e2e6d7235614171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Mon, 23 Sep 2019 19:56:10 +0200 Subject: [PATCH] Convert tabs to position-modulated run of whitespaces. --- libcanvas/CanvasImportStore.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcanvas/CanvasImportStore.py b/libcanvas/CanvasImportStore.py index d8afb3b..b985291 100644 --- a/libcanvas/CanvasImportStore.py +++ b/libcanvas/CanvasImportStore.py @@ -115,6 +115,10 @@ class CanvasImportStore(): inCurColours = (inCurColours[1], inCurColours[0]); inCurCol += 1; elif inChar == "\u001f": inCellState = self._flipCellStateBit(self._CellState.CS_UNDERLINE, inCellState); inCurCol += 1; + elif inChar == "\t": + for tabChar in range(8 - len(outMap[-1]) % 8): + outMap[-1].append([*inCurColours, inCellState, inChar]) + inCurCol += 1 else: outMap[-1].append([*inCurColours, inCellState, inChar]); inCurCol += 1; inLine, outMaxCols = inFile.readline(), max(outMaxCols, len(outMap[-1]))