EmEditor (text editor) Forum Index Macro Samples
Toggle Comments | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Antnee | Posted on: 5/17/2011 1:38 am |
Not too shy to talk ![]() ![]() Joined: 6/16/2010 From: Nottinghamshire Posts: 30 |
Toggle Comments Hi guys,
For my first attempt at macros, I decided to try a PHP comment toggler. This is because I can only find existing functions in EmEditor to comment or uncomment, but not to do both in one keypress. It basically just adds // to the beginning of the line if it's not there, and removes it if it is. It should put the cursor back where it was before hand. I have NO idea if this is the best way to do it or not, but it works perfect for me. What it doesn't do however is check every line - It only does the first. If anyone can extend its functionality to do that too it would be perfect for me. I suspect there's also a function somewhere to get the current configuration's comment and add that instead of the hard coded // that I've put in this? I hope it's of some use to some people? |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |


