Auto-fill newline asterisks in comment blocks?

Help with writing and playing macros

Auto-fill newline asterisks in comment blocks?

Postby ultra » Fri Feb 23, 2007 9:07 am

Hi guys

I've been trying to work out if this is possible in UEs for the last hour or so and it's driving me crazy.

Essentially the problem is that I am forced to use Eclipse at work, which is terrible but does have one very nice feature that I'd like to mimic in UEs.

When you're editing javadoc comment blocks in eclipse, it will automatically place an asterisk and a space when you hit return, saving you the effort of formatting it all nicely yourself.

Code: Select all
/**        <- press enter here
 *          <- this is output for you
 *          <- and again... etc...


Is there any way to make this happen?

cheers
User avatar
ultra
Basic User
Basic User
 
Posts: 33
Joined: Tue Jul 13, 2004 11:00 pm

Re: Auto-fill newline asterisks in comment blocks?

Postby mrainey56 » Fri Feb 23, 2007 11:36 am

Assign this macro to the Enter key. There are probably some bugs and unaccounted-for situations here, but you get the idea


Key LEFT ARROW
IfCharIs "/"
Key RIGHT ARROW
"
"
ExitMacro
Else
Key RIGHT ARROW
EndIf
Key HOME
IfCharIs "/"
Key RIGHT ARROW
Else
IfCharIs "*"
Key END
"
* "
ExitMacro
Else
Key END
"
"
ExitMacro
EndIf
EndIf
IfCharIs "*"
Key RIGHT ARROW
Else
Key END
"
"
ExitMacro
EndIf
IfCharIs "*"
Key END
"
* "
Else
Key END
"
"
ExitMacro
EndIf
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Auto-fill newline asterisks in comment blocks?

Postby ultra » Sun Feb 25, 2007 4:39 am

wow thats very helpful, thanks!
User avatar
ultra
Basic User
Basic User
 
Posts: 33
Joined: Tue Jul 13, 2004 11:00 pm


Return to Macros