Good evening,
If I were to add an extra "tag" for foldingStartMarker and foldingStopMarker in the PHP bundle, am I under the assumption that it would be read by the HTML bundle when TextMate sees it inside the <?php ?> region?
When I am editing a PHP file and set the bundle to PHP, the folding marks show up. But, when in HTML mode and use the same markers in the PHP region, the folding marks are no longer appearing.
Am I doing something wrong? Or do I need to do something else?
Thanks
If I were to add an extra "tag" for foldingStartMarker and foldingStopMarker in the PHP bundle, am I under the assumption that it would be read by the HTML bundle when TextMate sees it inside the <?php ?> region?
When I am editing a PHP file and set the bundle to PHP, the folding marks show up. But, when in HTML mode and use the same markers in the PHP region, the folding marks are no longer appearing.
No only the folding markers from the main language are used. To get what you want you need to add them to the HTML grammar.
Michael Sheets wrote:
No only the folding markers from the main language are used. To get what you want you need to add them to the HTML grammar.
Thanks for the info, Michael. Do you know if there are any plans to include that functionality when including the language in another language like HTML?
Hi all,
New TextMate user here. I will be using it in the main for PHP development. I understand that when writing PHP scripts that include portions of HTML outside the PHP tags, one should set the document language to HTML. This makes sense. However, for PHP files with no HTML portions (such as I am working on), should I set the language to HTML or PHP? Can you explain the difference, and the benefits or drawbacks of each option?
Thanks!
_________________
George
George Crawford wrote:
Hi all,
New TextMate user here. I will be using it in the main for PHP development. I understand that when writing PHP scripts that include portions of HTML outside the PHP tags, one should set the document language to HTML. This makes sense. However, for PHP files with no HTML portions (such as I am working on), should I set the language to HTML or PHP? Can you explain the difference, and the benefits or drawbacks of each option?
George,
When setting the language to PHP, you get the full range of Syntax highlighting, code folding, etc. When in HTML mode, you get the syntax highlighting, but that's about it. I experienced this the other day when I found out that the HTML PHP mode doesn't include code folding which is a serious drawback to me, but I can work around it...plus I don't like embedding PHP too much in my HTML :)
Thanks - that's enough reason for me!
_________________
George
On 8 Sep 2006, at 14:31, Derek Belrose wrote:
George Crawford wrote:
Hi all,
New TextMate user here. I will be using it in the main for PHP development. I understand that when writing PHP scripts that include portions of HTML outside the PHP tags, one should set the document language to HTML. This makes sense. However, for PHP files with no HTML portions (such as I am working on), should I set the language to HTML or PHP? Can you explain the difference, and the benefits or drawbacks of each option?
George,
When setting the language to PHP, you get the full range of Syntax highlighting, code folding, etc. When in HTML mode, you get the syntax highlighting, but that's about it. I experienced this the other day when I found out that the HTML PHP mode doesn't include code folding which is a serious drawback to me, but I can work around it...plus I don't like embedding PHP too much in my HTML :)
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 8/9/2006, at 15:31, Derek Belrose wrote:
When setting the language to PHP, you get the full range of Syntax highlighting, code folding, etc. When in HTML mode, you get the syntax highlighting, but that's about it.
The only thing extra is the PHP folding patterns. Everything else related to PHP is available (and active) when inside a <?php … ?> tag.
I will merge the PHP folding patterns so that they are the same (when using HTML as language).
For a long time the PHP grammar was not supposed to be used stand- alone (for other than testing “raw” PHP) -- but since so many kept selecting it as top language, I moved matching of <?php … ?> from the HTML grammar to the PHP grammar, so it would work (as people expected), so today the only disadvantage of using PHP as top language is, that one will not get HTML coloring for the stuff outside the <?php … ?> tags.
An advantage of using PHP as top language might be that the PHP (source) is not scoped as being “embedded” in HTML (text), so for example if using the All Hallows Eve theme, one will get the normal source code background color (black) rather than the text background color (dark grey) with the “embedded” PHP in a black (very large) box.
Thanks. Another stupid newbie question - how do I set the default language for new .php files to PHP rather than HTML?
Thanks!
_________________
George
On 8 Sep 2006, at 15:31, Allan Odgaard wrote:
On 8/9/2006, at 15:31, Derek Belrose wrote:
When setting the language to PHP, you get the full range of Syntax highlighting, code folding, etc. When in HTML mode, you get the syntax highlighting, but that's about it.
The only thing extra is the PHP folding patterns. Everything else related to PHP is available (and active) when inside a <?php … ?> tag.
I will merge the PHP folding patterns so that they are the same (when using HTML as language).
For a long time the PHP grammar was not supposed to be used stand- alone (for other than testing “raw” PHP) -- but since so many kept selecting it as top language, I moved matching of <?php … ?> from the HTML grammar to the PHP grammar, so it would work (as people expected), so today the only disadvantage of using PHP as top language is, that one will not get HTML coloring for the stuff outside the <?php … ?> tags.
An advantage of using PHP as top language might be that the PHP (source) is not scoped as being “embedded” in HTML (text), so for example if using the All Hallows Eve theme, one will get the normal source code background color (black) rather than the text background color (dark grey) with the “embedded” PHP in a black (very large) box.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
George - if you choose "PHP" from the list of langauges for one PHP file, they should all, by default, open as PHP. Textmate remembers your last association for that particular file extension.
t.
On 08/09/06, George Crawford g.o.crawford@gmail.com wrote:
Thanks. Another stupid newbie question - how do I set the default language for new .php files to PHP rather than HTML?
Thanks!
George
On 8 Sep 2006, at 15:31, Allan Odgaard wrote:
On 8/9/2006, at 15:31, Derek Belrose wrote:
When setting the language to PHP, you get the full range of Syntax highlighting, code folding, etc. When in HTML mode, you get the syntax highlighting, but that's about it.
The only thing extra is the PHP folding patterns. Everything else related to PHP is available (and active) when inside a <?php … ?> tag.
I will merge the PHP folding patterns so that they are the same (when using HTML as language).
For a long time the PHP grammar was not supposed to be used stand- alone (for other than testing "raw" PHP) -- but since so many kept selecting it as top language, I moved matching of <?php … ?> from the HTML grammar to the PHP grammar, so it would work (as people expected), so today the only disadvantage of using PHP as top language is, that one will not get HTML coloring for the stuff outside the <?php … ?> tags.
An advantage of using PHP as top language might be that the PHP (source) is not scoped as being "embedded" in HTML (text), so for example if using the All Hallows Eve theme, one will get the normal source code background color (black) rather than the text background color (dark grey) with the "embedded" PHP in a black (very large) box.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 8/9/2006, at 15:13, Derek Belrose wrote:
Michael Sheets wrote:
No only the folding markers from the main language are used. To get what you want you need to add them to the HTML grammar.
Thanks for the info, Michael. Do you know if there are any plans to include that functionality when including the language in another language like HTML?
Yes -- foldings should adapt to context (in the future) and I am also pulling them out of the language grammars (since the same language may change foldings based on context.)
The current system stems from having the “look for foldings”-parser different than the actual language parser (since the language parser wasn’t as powerful as now, when foldings were initially introduced).
Allan Odgaard wrote:
Yes -- foldings should adapt to context (in the future) and I am also pulling them out of the language grammars (since the same language may change foldings based on context.)
The current system stems from having the “look for foldings”-parser different than the actual language parser (since the language parser wasn’t as powerful as now, when foldings were initially introduced).
Great! Thanks Allan. I look forward to this update.
-Derek