Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix Xcode 4's useless uncommenting behavior

Tags:

xcode

xcode4

In Xcode 4, selecting the Uncomment command only works properly if the comment slashes are at the beginning of the line.

So using ⌘/ on this line:

// sudo make me a sandwich

results in this:

sudo make me a sandwich

But when the comment is indented:

    //sudo make me a sandwich

⌘/ results in this:

//    //sudo make me a sandwich

If my cursor is in a line that is a comment, I want ⌘/ to uncomment it. Period. Does anyone have a workaround/fix for this?

like image 562
Dan Avatar asked Apr 27 '11 19:04

Dan


1 Answers

Two solutions:

  1. Cmd-[ a few times to un-indent it, then Cmd-/ to uncomment, then Ctrl-i to re-indent it. A little lame, but you asked for a workaround, and there it is.
  2. File a bug at bugreport.apple.com, so that it can be brought to the attention of the engineers and fixed in a future release.
like image 98
BJ Homer Avatar answered Nov 09 '22 21:11

BJ Homer