jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

Auto-indent doesn't reset properly #154

Closed FichteFoll closed 8 years ago

FichteFoll commented 9 years ago

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:

/*
 * 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

wbond commented 8 years ago

This seems to be resolved as of dev build 3110.