commit 75b5499a3a9caa4b81214f82c3f0b5322376f918 Author: Richard Ipsum <[email protected]> AuthorDate: Fri Oct 9 15:52:07 2020 +0100 Commit: Michael Forney <[email protected]> CommitDate: Wed Oct 14 15:03:20 2020 -0700
fold: fix tabstop column count
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 {
