当前位置: 首页 > 工具软件 > Know2Comment > 使用案例 >

Selection block comment

汪阳飇
2023-12-01
Hello,

It strikes me as somewhat odd the decision to not provide quick access to the possibility of commenting a block of selected code. There's not even an option for this anywhere. I dealt with the problem by defining a new Surround With entry.

Just perhaps suggesting that you consider the possibility of making this option readily available at top level on the right-click menu.

Selecting a block of code and commenting it seems to me such a common thing, it would be great if access to it was almost mechanical.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I just retested this.  Surround with can be configured to create a block comment.  You may just have just gotten confused by the meaning of the "Surround with" checkbox on the aliases dialog, or you did not realize that surround with was configured through aliases in the first place.  Unfortunately, it is't blatantly obvious.

To create a block comment surround with alias.

1) Go to Tools > Options > File Extension Setup...
2) Select the file extension to customize, for example, "c" for C/C++
3) Switch to the General tab, and click on "Aliases..."
4) Check the "Surround with" check box to customize surround aliases
5) Click "New...", type in the name for the comment alias
6) Fill in the following for the comment text.
Code: [Select]
/*
%\m sur_text%
*/
7) Click OK when done

Of course, a more direct way to configure block comments is to go to "Document" > "Comment Setup...", and configure your block and line comment preferences.  Then you can use "Document" > "Comment Block" or "Comment Line" to comment out a block you have selected.

Let us know what works best for you.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In this case you should consider to use the mentioned BlockComment.e module.
Load it 'Macro->Load Module' and add the BlockComment command to your context menu / shortcut.

This command toggles between comment / uncomment the current selection or curr. line if nth. is selected.
You may easily adopt it to support more/other file extensions.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@HS2 --
Code: [Select]
( %\m sur_text% )
@Mario -- The commands are "box" for block comments, and "comment" for line comments.
(晕!I really don't like the way these guys doing things. Why not call it "block comment"? )

====
http://community.slickedit.com/index.php?topic=696.0


 类似资料:

相关阅读

相关文章

相关问答