none
How to align "<<" or ">>" written on different lines?

    Question

  • When I write "<<" or ">>" in Visual Studio Community, it aligns like this:

    cout << "Example line 1\n"
    << "Example line 2\n"
    << "Example line 3\n";


    I don't want to disable auto-formatting since I find it very useful (and I customized it to my preferences); is there a way to configure VSC to align "<<" and ">>" like this?

    cout << "Example line 1\n"
         << "Example line 2\n"
         << "Example line 3\n";


    Thank you!


    • Edited by RenanKJ Sunday, July 10, 2016 11:47 PM
    Sunday, July 10, 2016 11:46 PM

Answers

  • Since there is no such feature, then maybe try the next formatting too:

      cout

          << "Example line 1\n"

          << "Example line 2\n"

          << "Example line 3\n";

    Monday, July 11, 2016 5:39 AM

All replies

  • Hi RenanKJ,

    Thanks for your post.

    I did a test in my side and the behavior is same to yours.

    I also enable the following option, but still the same behavior.

    So I think this is by default in Visual Studio. And it seems it has format the braces.

    If you feel this behavior is not correct. I suggest you could submit as a feature request to the Visual Studio team:

    http://visualstudio.uservoice.com/forums/121579-visual-studio .

    The Visual Studio product team is listening to user voice there.

    Best Regards,

    Lake Xiao

    Monday, July 11, 2016 3:14 AM
    Moderator
  • Since there is no such feature, then maybe try the next formatting too:

      cout

          << "Example line 1\n"

          << "Example line 2\n"

          << "Example line 3\n";

    Monday, July 11, 2016 5:39 AM