commenting code

Ideas for new features

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

Post Reply
jimmeans
Posts: 2
Joined: Tue Jul 20, 2004 8:21 pm

commenting code

Post by jimmeans »

How about a way to select lines of code and have it commented out? The syntax files already define what is commented code, so Textpad already recognizes commented code. It seems like it would be easy to apply the syntax definition to selected text.
User avatar
skaemper
Posts: 51
Joined: Mon Mar 03, 2003 1:07 pm
Location: (Northern) Germany
Contact:

(Un)commenting lines of code

Post by skaemper »

Hi,

depending on what language you use, you might look for the already existing macros that do just that for you. You might like to look at the TextPad macros page.
If the existing macros don't fit your language, because they don't use the comment character(s) your language uses, just recored your own macro.
It should go something like
  1. Go to the first position in the line
  2. Insert the comment character(s)
  3. Move (the cursor) one line down
And let the macro run through the selected text.
Uncommenting lines of code, being equally useful, works very similar.
Another way you could try to achieve that is to use search & replace, but I haven't tried that and I'm not sure about what exactly TextPad searches for, when searching happenes in a macro (could well be the last search phrase you entered...)
That said, I'd rather not see this added as a default feature in TextPad since it's so easily added with TextPad itself.

Hope that helped

Stephan
"It's POLYMORPHIC!"
A former colleague
SLerman
Posts: 4
Joined: Wed Jul 14, 2004 10:07 pm

Post by SLerman »

Or just use a clip book. Take a look at samples\htmltags.tcl to see how to put stuff around selected text.
Post Reply