Hello,
I made some simple additions to the Objective-C Bundle, and was wondering if anyone was interested in them.
* Comment Reflow - based on the Screencast by Allan * Comment Code - comments out the current line of code (or the selected lines of code), useful for debugging * Uncomment code - undoes above
I know they are not very glamarous, but I was surprised they were not already included in the bundle.
- Nithin
Yeah, I knew about that. It doesn't work right. If you have /* */ comment in the block of code you are commenting then it will won't comment out everything after that /* */ comment. Plus, how do you undo it when you want to uncomment the code?
Actually how do others disable parts of the code they are not intersted in having executed? I would assume it is a common problem, either that, or I am the only one who doesn't trust their own code.
- Nithin
On 5/2/07, Jacob Rus jacobolus@gmail.com wrote:
Nithin Reddy wrote:
- Comment Code - comments out the current line of code (or the
selected lines of code), useful for debugging
- Uncomment code - undoes above
Try ⌘/ ;)
-Jacob
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 3. May 2007, at 05:03, Nithin Reddy wrote:
Yeah, I knew about that. It doesn't work right. If you have /* */ comment in the block of code you are commenting then it will won't comment out everything after that /* */ comment.
Yeah, /* … */ doesn’t nest, that’s really a language limitation — for this reason I am using // as the primary comment character, since that nests nicely.
The default for C and Objective-C was having /* … */ as primary, but I just changed that. FYI this is a preference in the C bundle.
Plus, how do you undo it when you want to uncomment the code?
It is a toggle. I.e. just hit ⌘/ again.
Actually how do others disable parts of the code they are not intersted in having executed? I would assume it is a common problem, either that, or I am the only one who doesn't trust their own code.
With // as the primary comment character, I think you’ll find ⌘/ nicer, as you can then comment partially commented regions.
But I often make use of #if 0 … #endif to disable code in C. This also nests nicely and TextMate will render the disabled part as a comment, and it allows you to use #else, for example:
#if 0 // old code #else // new code #endif
Now you can just change 0 to 01 (or just 1) to switch from the new code back to the old vice versa.
Yeah, /* … */ doesn't nest, that's really a language limitation — for this reason I am using // as the primary comment character, since that nests nicely.
The default for C and Objective-C was having /* … */ as primary, but I just changed that. FYI this is a preference in the C bundle.
I'm enamored with how /* ... */ looks, especially when it spans multiple lines.
Plus, how do you undo it when you want to uncomment the code?
It is a toggle. I.e. just hit ⌘/ again.
Thanks didn't know that.
But I often make use of #if 0 … #endif to disable code in C. This also nests nicely and TextMate will render the disabled part as a comment, and it allows you to use #else, for example:
#if 0 // old code #else // new code #endif
Now you can just change 0 to 01 (or just 1) to switch from the new code back to the old vice versa.
Thanks for the tip. In the past I used a different version of this technique:
#ifndef NOT_DEF //old code #endif
I stopped using it, because in Visual Studio it would left-align any macros, which looked very odd.
In any case, I like your way.