Re: [PATCH] whitespace: fix initial-indent checking
- From
- J. Bruce Fields <bfields@fieldses.org>
- Date
- Dec 16, 2007, 03:54 UTC
- Message-ID
- <20071216035440.GM14377@fieldses.org>
- In-Reply-To
- <1197776919-16121-5-git-send-email-bfields@citi.umich.edu>
On Sat, Dec 15, 2007 at 10:48:37PM -0500, J. Bruce Fields wrote:
Show 12 quoted lines
> After this patch, "written" counts the number of bytes up to and > including the most recently seen tab. This allows us to detect (and > count) spaces by comparing to "i". > > This allows catching initial indents like '\t ' (a tab followed > by 8 spaces), while previously indent-with-non-tab caught only indents > that consisted entirely of spaces. > > This also allows fixing an indent-with-non-tab regression, so we can > again detect indents like '\t \t'. > > Also update tests to catch these cases.
One slightly weird thing about this: I'd expect indent-with-non-tab to catch any sequence of 8 or more contiguous spaces, not just such sequences at the end of the indent. This doesn't quite do that.
You could make it do that with a few more lines of code. But really I don't think the combination of indent-with-non-tab without space-before-tab makes any sense.
The only reason I didn't just modify it to turn on the latter whenever the former is turned on is because I couldn't figure out how to modify t/t4124-apply-ws-rule.sh to pass.....
But, whatever, that's an extremely minor point. If people try that combination who knows what they expect.
--b.