[TxMt] Reformat php?

Brian Armstrong barmstrong at gmail.com
Sun May 6 06:22:19 UTC 2007


Hi All,

I'm new to Textmate, and I have to say I am most impressed!  What a
beautiful piece of software.  I downloaded the 30 day trial, and I am
having problems with one thing:  reformatting php code.

Let's say I had a piece of code like this:

// make sure it doesn't crash in an ugly way
if (!function_exists('foo'))
{
  die("this function required");
}

and I run the reformat on it, or ^Q, then I get this:

// make sure it doesn't crash in an ugly way if
(!function_exists('foo')) { die("this function required"); }

Not very helpful, and you notice that the 'if' is now on a comment line!

Note that this performs the same whether I have the file showing as
HTML or PHP.  Given the amount of work that's gone into PHP capability
overall (great completion for example) I'm shocked that this is
standard behavior out of the box.

Would love to get some tips from the textmate masters on here.  Thank you!
Brian Armstrong



More information about the textmate mailing list