- AuthorPosts
- October 5, 2006 at 9:00 am #3860RohitMember
Konbanwa Emura san! :)
Is it possible to comment / uncomment the current line in a document when no text has been selected on that line?
I can see the commands “Comment” and “Uncomment” in “Edit” | “Convert Selection,” but they are disabled unless some text is first selected.
Thanks,
RohitOctober 5, 2006 at 3:14 pm #3863Yutaka EmuraKeymasterIt is a specification that text must be selected before you can select each command in Convert Selection sub menu. However, it is possible to make it an option if many users like that way.
October 17, 2006 at 10:27 pm #3906SimonMemberIt makes sense for this option to be in the “Convert Selection” menu when you wish to comment multiple lines. However, it becomes restrictive when commenting just the current line. For correctness, I would suggest keeping the option as it is but also adding new options to the “Advanced” menu: Comment Line and Uncomment Line. They would fit nicely with the other options in that menu such as Duplicate Line.
October 18, 2006 at 5:01 am #3907Yutaka EmuraKeymasterIf you have EmEditor Professional, you can write a macro like this (JavaScript):
var bEmpty = false;
if( document.selection.IsEmpty ){
editor.ExecuteCommandByID(4154); // Select line if not selected
bEmpty = true;
}
editor.ExecuteCommandByID(4371); // Comment. Use 4372 for Uncomment.
if( bEmpty ){
document.selection.Collapse();
}This macro can comment selected lines if selected, or comment the current line if not selected.
Then you can customize menus to insert this macro to anywhere you would like.
- AuthorPosts
- You must be logged in to reply to this topic.