Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto formatting - Eclipse C++

Hi all I'm trying to stop the auto formatting in eclipse from indenting my opening and close brace after a function that has a throw() statement on the end.

e.g

void function(std::string param) throw()
{

}

after auto format will look like this:

void function(std::string param) throw()
  {

  }

But it will carry on adding another tab to the front of the brackets every time I autoformat my code. Anyone know how I can turn this feature off, or is it a bug

Eclipse info: Version: Juno Release Build id: 20120614-1722 using CDT

Note: I am using my own code style profile.

like image 215
Nark Avatar asked Sep 16 '25 04:09

Nark


1 Answers

The name of that style is Whitesmiths - Try to change it to Allman.

In C/C++ perspective mode, Goto Window > Preferences > C/C++ > Code Style

enter image description here

Choose BSD/Allman or whatever you want.

like image 127
masoud Avatar answered Sep 18 '25 16:09

masoud