Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Find blame's next tab stop the way ssdiff does
The mask only worked while TAB_WIDTH stayed a power of two.
| -rw-r--r-- | source/ui-blame.c | 5 |
1 file changed, 3 insertions, 2 deletions
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; } |
