Automatic starrey comments.

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
xconspirisist
Posts: 3
Joined: Thu May 25, 2006 2:35 am
Location: Great Britain.
Contact:

Automatic starrey comments.

Post by xconspirisist »

When you comment your code in large blocks (javadoc):

Code: Select all

/** 
 * This is a comment
 * 
 * blaat.
 */
It would be nice, when you tap enter, to automatically indent by a space, and add the * character to a new line.
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Not quite sure what you mean by "tap enter" but you could bind a macro to whatever keystroke you feel is handy. You could also probably bind a keystroke to hit the clip library to insert the comment block.
I choose to fight with a sack of angry cats.
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post by SteveH »

I think what is meant is effectively a pretty advanced form of code snippets. This would mean that once a block comment was started it would continue to create comment marks automatically until stopped.

The only app I have seen that does this is TextMate on Mac OS X. There is a screencast of this in action at http://macromates.com/screencast/scopes ... mments.mov but beware, it is about 61MB. It illustrates how to cause return (↩) to also insert an asterisk when used inside block comments such as:

Code: Select all

/* This is a block comment
 * which spans a few lines
 */
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

How about a macro that inserts Blocked Comments from the clip library, selects that blocked section and does a Search for "\n" and replace with "\n *" .

That macro could be assigned a hot key, and could be easily triggered to run when needed.
Hope this was helpful.............good luck,
Bob
I Steal Toast
Posts: 14
Joined: Wed Feb 02, 2005 3:05 am
Location: Why do you want to know? <_< >_>
Contact:

Post by I Steal Toast »

Can you not just

Code: Select all

/* Write your block comments
like this, without a star on
every line? */
It makes it easier to comment and uncomment large blocks of code that way, and the syntax highlighting should already make it fairly obvious what is and isn't a comment, so adding stars is a bit redundant IMO.
I stole your toast.
Post Reply