Eclipse C++ formatter puts new line before method identifiers

I hand edited two files under the main eclipse projects directory

.metadata\.plugins\org.eclipse.core.runtime\.settings

The two files:

file 1: org.eclipse.cdt.core.prefs, change this line from "insert" to "do not insert"
 org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert


file 2: org.eclipse.cdt.ui.prefs,
scan this file for "insert_new_line_before_identifier_in_function_declaration" and make a similar change from insert to do not insert next to it, should be obvious

Note I seen this problem on indigo and juno, the fix described above was in juno.


If you have a custom formatter config, export it first (settings>C/C++ General>Formatter>Edit>Export). Then change the following line to "do not insert". Save the XML.

<setting id="org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration" value="do not insert"/>

Delete the current config and import the one you changed.