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
Yutaka
Posted on: 1/13/2013 8:49 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2423
Re: Why Comment/Uncomment Functionality Becomes Enabled Only When Line(s) Selected?
You are right; the above code was to comment in all cases.

To toggle the comment, it will a little more complicated. To uncomment in all cases, here is the code:

if( document.selection.IsEmpty ){
	editor.ExecuteCommandByID(4154);
}
editor.ExecuteCommandByID(4372);


Thanks!


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

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 日本語 한국어 Русский 简体中文 繁體中文