EmEditor (text editor) Forum Index
   Questions and Answers about EmEditor Core
     Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
Register To Post

Threaded | Oldest First Previous Topic | Next Topic | Bottom
Poster Thread
Yutaka
Posted on: 1/11/2013 8:47 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2404
Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
Hello,

How about a macro like this:

[JavaScript]
if( document.selection.IsEmpty ){
	editor.ExecuteCommandByID(4154);
}
editor.ExecuteCommandByID(4371);


This macro will comment out the selection if the selections exists, or comment the current line if the selection does not exist.

Thanks!


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

ArthurZ
Posted on: 1/11/2013 6:27 am
Just can't stay away
Joined: 1/26/2012
From:
Posts: 78
Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
I see, but in my case I placed the Comment-Uncomment pair onto the toolbar.

Therefore IMHO, this limitation should not be in this case.

PS: This useful command (I use very often) is buried too deep in the menus, I suggest to elevate it.
Yutaka
Posted on: 1/10/2013 6:27 pm
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2404
Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
Hello,

Since these commands are in the "Convert Selection" sub menu of the Edit menu, I wanted to make them work same as other commands in the same sub menu. If I allowed these commands to work when unselected, I would have to allow all other commands to work when unselected.

Thanks for your inputs!


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

ArthurZ
Posted on: 1/10/2013 8:49 am
Just can't stay away
Joined: 1/26/2012
From:
Posts: 78
Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
I am thinking why not allowing commenting a line of code where the cursor currently is on?

Right now the Comment/Uncomment functionality becomes enabled only when line(s) are selected and this is small but un-needed limitation IMO.
« 1 (2)
Threaded | Oldest First Previous Topic | Next Topic | Top


Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文