From 75b5499a3a9caa4b81214f82c3f0b5322376f918 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Fri, 9 Oct 2020 15:52:07 +0100 Subject: [PATCH] fold: fix tabstop column count --- fold.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fold.c b/fold.c index a5a987d..9c3c919 100644 --- a/fold.c +++ b/fold.c @@ -39,7 +39,9 @@ foldline(struct line *l) { col = 0; break; case '\t': - col += (col + 1) % 8; + col += (8 - (col % 8)); + if (col >= width) + i--; break; } } else {