[TxMt] Indenting after comments

Eric Uner eric at uner.com
Thu Sep 27 16:32:46 UTC 2007


On Sep 27, 2007, at 7:00 AM, textmate-request at lists.macromates.com  
wrote:

>> If I have a C comment such as:
>>
>> / 
>> **------------------------------------------------------------------- 
>> --------
>> *                        xxxx
>> *-------------------------------------------------------------------- 
>> --------
>> */
>>
>> And I paste/type in some code right after this, textmate indents one
>> character. I cant use cmd+{ to correct it because then all the  
>> indenting in
>> the block I paste is incorrect.
>
> It does? I tried that in C++ mode, and I don’t seem to get  
> additional indent.

It does indeed - and the mode is C++. In the code you pasted you  
removed the leading spaces. Try

/**--------
(space)*
(space)*/

Then you will see what I mean.

I posted a file and window captures to my site:

http:://www.uner.com/sample.cpp
http:://www.uner.com/beforepaste.tiff
http:://www.uner.com/afterpaste.tiff

>> On a related note (loosely) the top of the block has a folding  
>> symbol next
>> to it in the gutter, but no corresponding symbol at the end of the  
>> block.
>> Comment folding would be great, but clicking on the symbol at the  
>> start
>> of the block has no effect.
>
> The default grammar is set to fold on /** and stop on **/. So you  
> would need to add another * for the stop marker of your comment,  
> then it should fold.
>
> E.g.:
>
>     /**
>      * This comment folds
>     **/
>

That does not fold for me either. The problem is the leading space.  
So in the file I uploaded, sample.cc, if you take out the leading  
space on line 13 then the comment folds.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20070927/bfb1b47b/attachment.html>


More information about the textmate mailing list