【问题标题】:CLion inconsistent auto indentation for line commentCLion 不一致的行注释自动缩进
【发布时间】:2018-10-16 15:53:00
【问题描述】:

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,它使用的是默认代码样式。似乎额外的缩进是由连续缩进设置控制的,但我只希望这个连续缩进设置应用于代码,而不是 cmets。使用 = 赋值时,在哪里可以更改我的设置以禁用注释的继续缩进?

【问题讨论】:

  • clion不是用clang-format吗?还是只有在您键入时才会出现这种缩进?
  • 如果您在菜单中四处看看,找到代码风格的设置应该不会那么难。至于缩进本身,这似乎是一个可能的错误,应该报告给the CLion issue tracker
  • @VTT 额外的缩进仅在我输入时发生。当我选择该块并再次单击自动缩进行时,CLion 实际上知道额外的缩进不正确并将其删除。
  • 我将在下一个 CLion 2018.2 EAP 中修复。

标签: c++ ide clion jetbrains-ide


【解决方案1】:

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

因为这个错误,我个人卸载了 CLion 2018.1,因为 EAP 足够稳定。

【讨论】:

    猜你喜欢
    • 2011-03-18
    • 2017-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-09
    • 2018-06-06
    • 2011-06-09
    相关资源
    最近更新 更多