用于行注释的CLion不一致的自动缩进 [英] CLion inconsistent auto indentation for line comment

查看:1727
本文介绍了用于行注释的CLion不一致的自动缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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?

推荐答案

此错误已在CLION 2018.2 EAP( https://www.jetbrains.com/clion/nextversion/ ) 。

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

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

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

这篇关于用于行注释的CLion不一致的自动缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆