Set auto-indent not to indent labels

痞子三分冷 提交于 2019-12-24 03:11:33

问题


I'm using Eclipse CDT on Windows. I should add that I'm delighted, overall, with the auto-format feature.

But one thing bugs me.

I can't figure out how to configure Eclipse to not indent lines with labels.

This is what I want:

void myfunc() {
    goto MYLABEL;

MYLABEL:
    return;
}

but what I get is this:

void myfunc() {
    goto MYLABEL;

    MYLABEL:
    return;
}

How can I configure Eclipse to get exactly what I want?

In Code Style --> Formatter, there's no section for "labels" under "Indentation".


回答1:


This is a bug in eclipse. I filed it in 2009 and it has yet to be fixed.

The C/C++ development tools plugin seems to be very poorly maintained, as I have quite a few bugs and enhancement requests outstanding which have languished for years.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=268404



来源:https://stackoverflow.com/questions/21994909/set-auto-indent-not-to-indent-labels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!