Hi,
Another one for the pile...
Not sure if this has been picked up before but the following steps demonstrate a bug in the folding logic:
1. Create a TM new document 2. Past in the following test php code:
function test() {
/* multiline comment */
some stuff... }
3. Set the syntax highlighting as PHP 4. Notice that it correctly identifies the start and end of the function as a folding block as well as the start and end of the comment as a nested folding block 5. Do Cmd-Alt-0 to collapse everything or click on the fold by 'function ...'
You should find the text from some stuff... onwards is not collapsed. If you first collapse the comment (using F1 or clicking on the icon) you can then collapse the function without problems.
I might be wrong, but I don't think this is a problem with the PHP bundle, as it is correctly identifying folds.
Cheers, James
On Nov 21, 2004, at 1:50, James Andrews wrote:
I might be wrong, but I don't think this is a problem with the PHP bundle, as it is correctly identifying folds.
The problem is that currently it only looks at indent to figure out nesting, and in your example the function and comment had same indent, that's why it doesn't match them correctly.
Good point. I'm often commenting out chunks of code while developing, but I'd forgotten that it was an indenting issue (I'd assumed it was counting the no. of opens/closes as well as using indents).
In future, I'll just indent my comments.
Thanks for your help, Allan. James
On 23 Nov 2004, at 05:06, Allan Odgaard wrote:
On Nov 21, 2004, at 1:50, James Andrews wrote:
I might be wrong, but I don't think this is a problem with the PHP bundle, as it is correctly identifying folds.
The problem is that currently it only looks at indent to figure out nesting, and in your example the function and comment had same indent, that's why it doesn't match them correctly.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate
I just wanted to comment on the folding technique... I think it's actually rather smart and enforces better coding, especially when writing HTML. I didn't realize that folding was based on indentation until I read about it on this list, and now I use it as an quasi-debugging tool! :)
Chris
James Andrews wrote:
Good point. I'm often commenting out chunks of code while developing, but I'd forgotten that it was an indenting issue (I'd assumed it was counting the no. of opens/closes as well as using indents).
In future, I'll just indent my comments.
Thanks for your help, Allan. James
On 23 Nov 2004, at 05:06, Allan Odgaard wrote:
On Nov 21, 2004, at 1:50, James Andrews wrote:
I might be wrong, but I don't think this is a problem with the PHP bundle, as it is correctly identifying folds.
The problem is that currently it only looks at indent to figure out nesting, and in your example the function and comment had same indent, that's why it doesn't match them correctly.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate