Author Topic: Explicit Comment and uncomment shortcuts (as well as toggle)  (Read 15573 times)

Anonymous

  • Guest
I personally don't always find it particularly useful to toggle comments, in the way that the "[ctrl]+[shift]+[c]" shortcut currently works.  If one wishes to temporarily comment a block of code, also containing some lines which are natural language comments, the original comments become uncommented, and one has to go through more manually adjusting things.

The way the Eclipse editor, for instance, works, is that there are separate shortcuts to comment and uncomment the selection.  These work quite similarly to indent / unindent, so "//" style comments are added to, or removed from the beginning of lines accordingly.

Perhaps it is good programming practice to avoid these kinds of situations as much as possible.  However, for a relative newbie such as myself, I do find myself wanting to quickly test (or attempt to compile :oops:) a program with a chunk of code removed quite often.

It should be a trivial modification, if any of the devs finds some time to implement it, I think it would be a worthwhile improvement.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Explicit Comment and uncomment shortcuts (as well as toggle)
« Reply #1 on: June 30, 2005, 05:46:41 pm »
The (un)commenting feature was contributed by a user early enough, so it was better to have it than nothing ;)
A feature request exists for this and will be implemented, probably before the next update.

Yiannis.
Be patient!
This bug will be fixed soon...

Anonymous

  • Guest
Explicit Comment and uncomment shortcuts (as well as toggle)
« Reply #2 on: July 01, 2005, 10:51:22 am »
Excellent news.  In future if I have any feature requests, I'll use the designated form.

Thanks, as always, for the great work you're doing.

CrayzeeIvan

  • Guest
Explicit Comment and uncomment shortcuts (as well as toggle)
« Reply #3 on: July 01, 2005, 06:39:08 pm »
I did the necessary modifications to Code::Blocks (CVS version), it now has two new commands in the "Edit" menu: "Comment" and "Uncomment". The old "Comment / uncomment" command was renamed to "Toggle comment". I took the code of the original commenting function and made two new functions out of it, so the code should be pretty stable.

How can I contribute the code to C::B?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Explicit Comment and uncomment shortcuts (as well as toggle)
« Reply #4 on: July 01, 2005, 06:42:41 pm »
Submit a patch at sourceforge...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

CrayzeeIvan

  • Guest
Explicit Comment and uncomment shortcuts (as well as toggle)
« Reply #5 on: July 01, 2005, 09:40:56 pm »
Okay, did it. I hope it will be of use for you, it's my first contribution to C::B :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Explicit Comment and uncomment shortcuts (as well as toggle)
« Reply #6 on: July 01, 2005, 10:14:34 pm »
Quote from: CrayzeeIvan
Okay, did it. I hope it will be of use for you, it's my first contribution to C::B :)

Thanks a lot. Keep 'em coming  :lol:

Yiannis,
Be patient!
This bug will be fixed soon...