Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Volte
Oct 4, 2004

woosh woosh

KernelSlanders posted:

Intellij does "/" for comment and uncomment, and it really pisses me off. For your code fragment, it would comment that including double commenting the already commented lines.
That seems like the correct action to me. A toggle-able commenting action should be fairly trivially invertible. If you select a block of code and use the comment toggle, it should make a best-effort attempt to comment it out in the way that makes the most practical sense and can be immediately reversed by invoking the command again. To me, that means commenting the entire block out unless every line is already commented out, in which case uncomment. It doesn't nail every use case but in most cases that's what I would want. If you want a command that uncomments all commented lines within a selection, that's an uninvertible command and I feel like it should be a separate thing from the usual 'toggle comment' command.

Adbot
ADBOT LOVES YOU

  • Locked thread