Sublime Forum

Indentation rules

#1

In /Packages/PHP/ there is a file, “Indentation Rules.tmPreferences” and it has some regex in it that is way too complicated for me to understand. What I’d like to know is if this is the file that controls the indent on a closing parentheses. Currently in PHP, a closing parentheses does not always go back to the place where the line above it starts, and this is super annoying for me. Please help me figure out how to make the closing parenthesis go where I want it. I did buy a license for Sublime Text 2 if it makes a difference. If I must pay extra to make this work the way I want it, let me know.

BAD

// closing parentheses is not in line with line above it
$arr = array(
        )

GOOD

// closing parentheses is in line with line above it
$arr = array(
)
0 Likes

#2

I’d hope to be proved wrong but I have a feeling that indentation rules in tmPreferences files are not really used.

I think so because just now I got sick of indentation staying at the same level when pressing enter at the end of block like this:

if (1) DoSomething();

and wanted to find a way to fix that. I’ve tried changing Indentation Rules.tmPreferences in C++ bundle but that didn’t seem to change anything (another issue is that rules are pretty difficult to understand, even if I know regexp). I’ve also tried removing file completely but indentation was still working as before, no worse or better.

0 Likes