locked
Ctrl+Enter on block doesn't indent caret on new line RRS feed

  • General discussion

  • Don't know how many people use this feature, but I've gotten into the habit of using it frequently when writing a new method.  After setting the ending brace on a block, I'll press Ctrl+Enter, which creates a new line above the caret (between the begin and end curly braces) and then moves the caret to the indented position on the new line.  I begin typing from there.

    I just tried this in VS2010 and it almost worked, except that the caret ended up on the first column, instead of indented.

    Joe
    Free C# Tutorial @ http://www.csharp-station.com
    Thursday, January 15, 2009 5:48 PM

All replies

  • Hi Joe,

    Do you have Smart Indenting turned on?  To set this option, go to Tools-->Options-->Text Editor-->All Languages-->Tabs.  Under "Indenting," choose "Smart."

    If the problem persists even with smart indenting, I'd encourage you to file a bug.  To log a bug, go to https://connect.microsoft.com/VisualStudio and click on "New Bug."  Once you fill in and submit the bug form, the bug will be investigated and may be escalated to a product team to fix.

    Thanks for trying out the CTP and sharing your feedback.

    Brittany Behrens
    Program Manager, Visual Studio Platform
    Friday, January 16, 2009 2:04 AM
    Moderator
  • Hi Brittany,

    I followed the steps you gave me and Smart wouldn't stay selected and it still didn't work.  So, I went ahead and submitted a bug with the details.

    Thank You,

    Joe


    Free C# Tutorial @ http://www.csharp-station.com
    Friday, January 16, 2009 3:08 AM