关闭

Selection block comment

标签: extensioncommentscommandaccessfiledialog
545人阅读 评论(0) 收藏 举报
分类:
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.
/*
%\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 --
( %\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


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:355542次
    • 积分:4047
    • 等级:
    • 排名:第7970名
    • 原创:6篇
    • 转载:246篇
    • 译文:0篇
    • 评论:18条
    文章分类
    最新评论