Properly indent even if the indenting character isn't the last one
commitd152c5ce2235c0bd34cc76613e3045100f95a4b9
authorColomban Wendling <ban@herbesfolles.org>
Tue, 7 Aug 2012 15:50:17 +0000 (7 17:50 +0200)
committerColomban Wendling <ban@herbesfolles.org>
Tue, 7 Aug 2012 15:50:17 +0000 (7 17:50 +0200)
tree15f4abc31743806ed36a63cb8543fca4c9e0c5a7
parent4c2d8998d736d67215e0e1d7057505f19af6ae2f
Properly indent even if the indenting character isn't the last one

For all languages, this change allows comments at the end of the
checked line, e.g.:

if 42:  # magic number
print("I'm indented!")

For languages with braces, it also properly indent if there is code
on the same line as the opening brace, e.g.:

if (42) { printf("some code here...");
printf("...but I'm properly indented");
} else { /* comment! */
printf("normal block is fine too, of course");
}

Although this is uncommon (and quite ugly) it's valid and should be
handled properly.
src/editor.c