This is an issue for me in C, and my searching in Google shows it's an issue in other languages as well (including Python). Auto-indent doesn't reset properly after some block elements that are indented, such as block comments in C:
/*
* This is a block comment in C
*/
// This line is fine
#include <stdio.h> // So is this one
// This line is automatically indented a space
int main(int argc, char **argv) // Manually moved this back to column 1
{
return 0;
}
// Everything after here is okay
// but Reindent Lines indents lines 10, 11, and 13
I don't know why, but it seems to be triggered by the include directive in C, and anything after that is indented to the level the block comment was. Starting a function seems to properly reset it, but using Reindent Lines will move the function to the level the block comment was, which is sort of a problem.
I'm using ST3 build 3083, but this appears to have been an issue since at least 2012, judging from what I've seen on Google. I can verify this is an issue without any packages installed as well.
Copied from original issue: SublimeTextIssues/Core#998
From @demize on September 23, 2015 2:34
This is an issue for me in C, and my searching in Google shows it's an issue in other languages as well (including Python). Auto-indent doesn't reset properly after some block elements that are indented, such as block comments in C:
I don't know why, but it seems to be triggered by the include directive in C, and anything after that is indented to the level the block comment was. Starting a function seems to properly reset it, but using Reindent Lines will move the function to the level the block comment was, which is sort of a problem.
I'm using ST3 build 3083, but this appears to have been an issue since at least 2012, judging from what I've seen on Google. I can verify this is an issue without any packages installed as well.
Copied from original issue: SublimeTextIssues/Core#998