Wrong indentions of a simple if-clause
OlofT opened this issue · 7 comments
The indentions of a simple if-clause gets wrong:
<?php
if (true)
{
some code
}
?>
It should of-course look like this:
<?php
if (true)
{
some code
}
?>
Works correctly here either if I type the if line-by-line or select it and choose Text → Indent Selection.
Are you in PHP mode (status bar) and are you using the stock PHP bundle w/o modifications?
100% sure (otherwise there wouldn't be a need for posting, right?)
Well, knowing that you are 100% sure doesn’t help me troubleshoot your issue.
Can you provide steps to reproduce? Can you test this both by typing line-by-line and by selecting the code and select Text → Indent Selection and let me know if both behave wrong. And when you select the code, be sure to not include the surrounding <? and ?> tags (as that might make it use HTML indent patterns).
I see the same behaviour. As soon as I hit return at the end of the first line, it sticks a tab in there. Doing the indent from the Text menu works correctly. I don't care about this for the if clause, but the same behaviour happens with function and class declarations.
<?php
function foo($bar)
{
baz();
}
?>@miken32 Could be that something has overloaded the return key. You can use Bundles → Select Bundle Item… (⌃⌘T) to find the potential culprit (switch to key equivalent search / ⌘4).
Just went into preferences and unchecked every bundle except the PHP bundle and things broke bad. So I unchecked PHP and re-checked it, which installed a bunch of other dependencies as well. So now running on the bare minimum and it still isn't working properly.
<?php
function foo($bar)
{
baz();
}
?>(As an aside, I got an error when typing the initial <?php tag and hitting enter -- "exit_insert_snippet: command not found.")
Remove these two folders:
~/Library/Application Support/Avian
~/Library/Application Support/TextMate
That will remove any potential customizations and also ensure you get the default bundles back (that should fix the error you get).
As for the issue in this ticket, turns out there is actually a problem and it was introduced with commit a23d870 — @infininight why was this change made?