Getting Edit | Comment Add to use block comments

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Getting Edit | Comment Add to use block comments

Postby sjibben63 » Tue Mar 29, 2005 6:44 pm

Hello,

I do a lot of HTML/ColdFusion work and those languages tend to only have block comments.

Is there a way to set up UE so that it will use block comments instead of single line comments for the Edit | Comment Add feature? This feature is always greyed out (disabled). I think that is because there isn't a line comment defined in my wordfile.

I'm working on converting from MultiEdit 9.x to UE and ME could put a block comment on each line or as a block depending on how you highlighted the code to be commented. Example:

<!--- single block
comment for lots
of lines
of code when highlighed in a stream. --->

or

<!--- many block --->
<!--- comments for lots --->
<!--- of lines --->
<!--- of code when highlighted as full lines. --->

I also had hot keys for quickly commenting/uncommenting code. That should be easy to set up if I can get UE to use block comments...

Thanks,
sj
User avatar
sjibben63
Newbie
 
Posts: 1
Joined: Tue Mar 29, 2005 12:00 am

Re: Getting Edit | Comment Add to use block comments

Postby Mofi » Wed Mar 30, 2005 1:51 am

This can be solved with macros, which are assigned to hotkeys and automatically loaded (not executed) at start of UE. The macros modify only when something is selected and the file extension is .html or .htm.

Macro for adding "line" comments:

InsertMode
ColumnModeOff
HexOff
UnixReOff
IfSel
IfExtIs "html"
Find RegExp "%^(*^)$"
Replace All SelectText "<!-- ^1 -->"
Else
IfExtIs "htm"
Find RegExp "%^(*^)$"
Replace All SelectText "<!-- ^1 -->"
EndIf
EndIf
EndIf

Macro for removing "line" comments:

InsertMode
ColumnModeOff
HexOff
UnixReOff
IfSel
IfExtIs "html"
Find RegExp "%<!-- ^(*^) -->$"
Replace All SelectText "^1"
Else
IfExtIs "htm"
Find RegExp "%<!-- ^(*^) -->$"
Replace All SelectText "^1"
EndIf
EndIf
EndIf
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to UltraEdit General Discussion