[PATCH 2/2] bugfix: make ss-diff correctly handle tab expansion

Julius Plenz plenz at cis.fu-berlin.de
Tue Oct 30 18:12:57 CET 2012


* Jason A. Donenfeld <Jason at zx2c4.com> [2012-10-30 17:58]:
> Doing it this way, you don't have to hard code the initial space,
> since m % n < n.

Not really true. If you are in the 8th column (i.e., there are 8
characters on the line), you need a tab to be 8 spaces wide.
Otherwise, a tab should pad to the next multiple of 8.

So it's rather: len % 8 == 0 ? 8 : (8 - len % 8)

Julius




More information about the CGit mailing list