用于行注释的CLion不一致的自动缩进

时间:2018-05-06 20:09:25

标签: c++ ide clion jetbrains-ide

在CLion中有一些奇怪的自动缩进,我不明白为什么。这是一个例子

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

似乎每当我使用=来初始化变量,然后在行的末尾添加注释时,它会在下一行给我额外的缩进。但在所有其他情况下,它不会给我额外的缩进。

我最近安装了CLion,它使用的是默认代码样式。看起来额外的缩进是由continuation indent设置控制的,但我只希望这个continuation缩进设置应用于代码,而不是注释。在使用= for assignment时,我可以在哪里更改设置以禁用注释的继续缩进?

1 个答案:

答案 0 :(得分:2)

此错误已在CLion 2018.2 EAP(https://www.jetbrains.com/clion/nextversion/)中修复。

由于EAP足够稳定,因此我亲自卸载了CLion 2018.1。

相关问题