millermedeiros/vim-statline — pull request #16 by scrooloose (2011-12-20 22:59:46+00:00)
Title: make the indent warning more fool proof

Allow spaces to be used to align at the start of the line up to one tabstop in width.

Previously we checked for any run of spaces not followed by a * (i.e. for long c style comments)

This worked fine for stuff like

/*
* comment at the start of the line
*/

but did not catch the case where a long comment was > 1 indent level in and indented with spaces instead of tabs. e.g. a file is indented with tabs and has

--->--->/*
* omg this should have been indented with tabs and aligned with
* a space
*/
--->--->int main() {
--->--->}

It also did not allow for alignment that occurring at less than one indent level, e.g. (assuming tabstop is set to 8)

foo("bar",
"baz");

My version can still break in this case (if &tabstop is set to <= 4) but it will report less false positives.