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

Flat Previous Topic | Next Topic
Poster Thread
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.
Flat Previous Topic | Next Topic


Subject Poster Date
   Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/10/2013 8:49 am
     Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? Yutaka 1/10/2013 6:27 pm
       Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/11/2013 6:27 am
         Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? Yutaka 1/11/2013 8:47 am
           Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/11/2013 9:27 am
             Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? Yutaka 1/13/2013 8:49 am
               Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/13/2013 4:59 pm
                 Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? mguttman 1/14/2013 12:27 am
                   Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/14/2013 5:33 am
                     Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? mguttman 1/15/2013 3:35 am
                       Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/15/2013 6:42 am
                         Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? mguttman 1/15/2013 7:20 am
                           Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? ArthurZ 1/15/2013 7:47 am
                         » Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected? JohnQSmith 1/17/2013 12:11 pm

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