commenting an entire block with !-----

General questions about using TextPad

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

Post Reply
weschrist
Posts: 3
Joined: Fri Nov 19, 2010 3:31 pm

commenting an entire block with !-----

Post by weschrist »

Hi,

I have the following text:

asdf
asdf
asdf

I would like to highlight say the first 2 lines, push CTRL+K, and make it look like this:

!-----asdf
!-----asdf
asdf

Somehow I created a macro to do this a few months ago, recently reinstalled Textpad, and now I can't figure it out.

My closest attempts end in either the !----- overwriting the highlighted text or only the first line is highlighted.

Thanks
weschrist
Posts: 3
Joined: Fri Nov 19, 2010 3:31 pm

Post by weschrist »

Nothing????
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You don't need a macro to do that. Use Search | Replace... (<F8>):
Find what: ^
Replace with: !-----

[X] Regular expression

Replace All
weschrist
Posts: 3
Joined: Fri Nov 19, 2010 3:31 pm

Post by weschrist »

Thanks Ben. Now I can just make that sequence a macro with a shortcut key.
Post Reply