From 5da1cfe1e7e2b270abf1442875ca39d470dde16d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:30:15 -0700 Subject: Find blame's next tab stop the way ssdiff does The mask only worked while TAB_WIDTH stayed a power of two. --- source/ui-blame.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/ui-blame.c b/source/ui-blame.c index 5c8dbd6..2e281cf 100644 --- a/source/ui-blame.c +++ b/source/ui-blame.c @@ -198,9 +198,10 @@ static size_t line_width(struct blame_scoreboard *sb, int line) pos += len; continue; } - width++; if (*pos++ == '\t') - width = (width + TAB_WIDTH - 1) & ~(TAB_WIDTH - 1); + width += TAB_WIDTH - width % TAB_WIDTH; + else + width++; } return width; } -- cgit