如何在Ucrustify"标签选项卡SPACE"中删除SPACE - 缩进?

时间:2015-01-21 10:12:11

标签: c++ uncrustify code-formatting

我的源代码

namespace one { namespace two {
->  static const class Example :
->  ->  Int1, Int2, Int3
->  {
->  public:
->  Example::~Example() :
->  ->  S1(),
->  ->  S2(),
->  ->  S3() {
->  ->  // if statements with empty braces
->  ->  if ( x )
->  ->  {
->  ->  }
->  ->  }
->  }
->  }
} } //namespace one::two

由Uncrustify处理为(“+”= SPACE)

namespace one { namespace two {
->  +static const class Example :
->  ->  +Int1, Int2, Int3
->  +{
->  +public:
->  +Example::~Example() :
->  ->  +S1(),
->  ->  +S2(),
->  ->  +S3() {
->  ->  +// if statements with empty braces
->  ->  +if ( x )
->  ->  +{
->  ->  +}
->  ->  +}
->  +}
->  +}
} } //namespace one::two

在TAB缩进后总是添加一个空格(“+”)。

我可以在哪里配置?

最佳, 本

1 个答案:

答案 0 :(得分:0)

我自己找到了原因......

Uncrustify无法处理

namespace one { namespace two {
如果两者都在同一行上定义,则

正确。当我将其改为

namespace one { 
namespace two {

然后它工作正常,没有插入空格!

相关问题