[TxMt] PHP tag on first line of file trips up HTML bundle

Nathan Duran textmate at khiltd.com
Fri Feb 8 21:33:30 UTC 2008


I've been wrestling with this one for a bit and I can't seem to find  
the right combination of bundle edits to make things work the way I  
think they should.

When using PHP, it is oftentimes necessary to place a "<?php" tag  
right at the beginning of the file, as any leading whitespace will  
render the header() function useless. Unfortunately, whenever I open  
such a file in TextMate, it is not recognized as HTML. There's no  
syntax highlighting, no autocompletion, nothing. Getting rid of the  
opening PHP block, or simply inserting a space in front of it sets  
everything right, but then the script obviously stops working.

The HTML bundle has two separate patterns declarations pertaining to  
PHP, one which requires leading whitespace, and another which does  
not. Mucking around with these patterns has yielded no improvements,  
and I'm not sure where else to look at this point. Find doesn't work  
in the bundle editor, and hitting the "Test" button or reloading  
bundles makes you lose your place in the file, so trial-and-error is  
an especially painful process here. The handful of search terms I  
could come up with didn't turn up anything, so I'm looking to see if  
anyone has any suggestions.

Thanks





More information about the textmate mailing list