0

I have a problem with eclipse's code style, here is the problem:

when I write an accessor or a modifier in C++ code, for example:

string GetName() { return name; }

then I press ctrl+shift+f and this line becomes:

string GetName() {
    return name;
}

But I just want it to stay the way like:

string GetName() { return name; }

How can I configure that? In other words how can I configure so one line code can stay in one line after I press ctrl+shift+f?

Expand the situation, how can I configure that in case of Java with eclipse?

Thank you!

Sincerely,

Larry Morries
  • 669
  • 7
  • 17

1 Answers1

0

There's a way to do that in control statements (in the code formatting options, go to the "Control Statements" tab, "if else" section, and choose "keep simple if in one line"), but I don't think you can do that for functions.

littleadv
  • 20,100
  • 2
  • 36
  • 50