简体   繁体   中英

On eclipse C++ code style single line format

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,

有一种方法可以在控制语句中执行此操作(在代码格式设置选项中,转到"Control Statements"选项卡的"if else"部分,然后选择"keep simple if in one line" ),但是我不认为您可以可以做到这一点的功能。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM