Commit 718516bdb5ed72e3efabaeced654c82fa43b33ec

Stefan Sperling 2019-02-25T10:45:47

fix TABs causing line display overflow in tog format_line()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tog/tog.c b/tog/tog.c
index 91c6bf2..8bf29ee 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -864,7 +864,7 @@ format_line(wchar_t **wlinep, int *widthp, const char *line, int wlimit)
 			break;
 		case -1:
 			if (wline[i] == L'\t')
-				cols += TABSIZE - ((cols + 1) % TABSIZE);
+				cols += TABSIZE - ((cols + 1) % TABSIZE) + 1;
 			i++;
 			break;
 		default: