From mboxrd@z Thu Jan 1 00:00:00 1970 From: plenz at cis.fu-berlin.de (Julius Plenz) Date: Tue, 30 Oct 2012 18:12:57 +0100 Subject: [PATCH 2/2] bugfix: make ss-diff correctly handle tab expansion In-Reply-To: References: <1351601762-953642-1-git-send-email-plenz@cis.fu-berlin.de> <1351601762-953642-3-git-send-email-plenz@cis.fu-berlin.de> <20121030145653.GB378591@plenz.com> Message-ID: <20121030171257.GC378591@plenz.com> * Jason A. Donenfeld [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