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 | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
ArthurZ
Posted on: 1/15/2013 6:42 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?
Hello Meir,

Yes, the macro is designed to work on a single line of unselected text.
This is because in the rest of the situations we have the right-click -> Convert Selection > Comment/Uncomment functionality or you can pull these two buttons onto the toolbar.
Agin, the latter just does not work for a single un-highlighted line of code - hence the macro.

I must add, this creates some uncomfort for me - split, non-unified functionality .

Hope Yutaka is listening: I suggest a change to allow commenting code regardless of whether a line is highlighted/selected.
mguttman
Posted on: 1/15/2013 7:20 am
Just can't stay away
Joined: 11/14/2009
From: Ashdod, Israel
Posts: 76
Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
Thanks Arthur,

OK...

Hmmm! IMHO, the most desirable functionality is a single, toggle command which can be assigned a keyboard shortcut, working on the current line if none is selected or on all selected lines is. If any of these are already commented out, uncomment it!

Toggle, because obviously if it is already commented out, why would you want to comment it out again? Also in the opposite direction.

Yes I am sure Yutaka is listening. He always does, and that is not the least reason that I am using EE


----------------
Regards,
Meir

ArthurZ
Posted on: 1/15/2013 7:47 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?
My both thumbs are up for the proposed!

By the way your rephrase Meir: "Toggle" is the word and the way to go.
JohnQSmith
Posted on: 1/17/2013 12:11 pm
Not too shy to talk
Joined: 7/15/2011
From:
Posts: 30
Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
Quote:
Hmmm! IMHO, the most desirable functionality is a single, toggle command which can be assigned a keyboard shortcut, working on the current line if none is selected or on all selected lines is. If any of these are already commented out, uncomment it!

Toggle, because obviously if it is already commented out, why would you want to comment it out again?


Because the code I'm editing already has comments that I want to keep. For example,

... 
for(int i=0;i<10;i++) {
// the following line prints incremented variable
   printf("%d",i);
}
...


Using your idea, if I wanted to comment out that loop, I'd end up with

...
//for(int i=0;i<10;i++) {
 the following line prints incremented variable
//   printf("%d",i);
//}
...


which would be wrong.

If I comment out that block, it should add additional comments on previously commented lines like

...
//for(int i=0;i<10;i++) {
//// the following line prints incremented variable
//   printf("%d",i);
//}
...


that way when I later uncomment it, it will be back the way it was when I started.
« 1 (2)
Threaded | Newest First Previous Topic | Next Topic | Top


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