cout<<"hello"<<endl;        //line1
//    cout<<"hello"<<endl;        //line2
      //    cout<<"hello"<<endl;  //line3
      //cout<<"hello"<<endl;      //line4
      //                                        cout<<"hello"<<endl; //line 5            
I write the line1.
Then I comment line1 using command+/, it becomes line2.
But when I Re-Indent line2 using control+I (Or pasting the line to another place in Xcode), It becomes line3.
I think the blank after "//" is very ugly in line3. Sometimes it will be very long such as line 5.
So I want to know is there a shortcut to comment the line1 to line4, so it will not be inflounced by Re-Indent or Paste?
Update:
Is it possible to change the way Xcode indents comment blocks?
I try this command from this answer in command line. And reboot Xcode and system.
But It still get line3.
defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict PreExpressionsSpacing  "" PreCommaSpacing " "
I want to change the way xcode indents comment "line", not "blocks" So, this question is different from mine. And it can not solve my problem.
There is a Xcode extension for commenting just before indented code.
It makes like
    cout<<"hello"<<endl;        //line1
    // cout<<"hello"<<endl;     //line2`
So a indent of commented block is not changed even after re-indent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With