CLion inconsistent auto indentation for line comment

喜欢而已 提交于 2019-12-09 13:33:05

问题


There are some weird auto indentation going on in CLion that I don't understand why. Here is an example

int i1(5); // some comments, then I hit Enter
// auto indentation goes here. I hit Enter again
// It goes here
float f = 5; // some comments, then I hit Enter
    // then auto indentation goes here. I hit Enter again
        // It then goes here.
float f2 = 6;
// If I don't comment on the previous line, there is no weird indentation

It seems like whenever I use = to initialize an variable, and then add comment at the end of the line, it will give me extra indentation on the next line. But in all other instance, it will not give me extra indentation.

I recently installed CLion and it was using default code style. It seems like the the extra indentation is controlled by the continuation indent setting, but I only want this continuation indent setting be application to codes, not comments. Where can I change me setting to disable the continuation indentation for comment when using = for assignment?


回答1:


This bug has been fixed in CLion 2018.2 EAP (https://www.jetbrains.com/clion/nextversion/ ).

I personally uninstalled CLion 2018.1 because of this bug, since the EAP was stable enough.



来源:https://stackoverflow.com/questions/50204073/clion-inconsistent-auto-indentation-for-line-comment

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