在换行的命令行中,取消//后面的空格的合理性
uncrustify space after // in wrapped command line
我使用以下参数的uncrustify:
sp_cmt_cpp_start = force # Add space after opening '//'
cmt_width = 78
输入:
bi.dwSize = sizeof (bi); //Size of the structure itself, must be initialized with sizeof(CGOSBOARDINFO)
输出:
bi.dwSize = sizeof(bi); // Size of the structure itself, must be
//initialized with sizeof(CGOSBOARDINFO)
但在//第二行"//initialized"之后,应该看起来像:
bi.dwSize = sizeof(bi); // Size of the structure itself, must be
// initialized with sizeof(CGOSBOARDINFO)
有人知道如何解决这个小问题吗?
我已将问题提交给Uncompustify。如果你关心并能够从源头重建不可信,我也有一个可能的解决方案。
https://github.com/bengardner/uncrustify/issues/95
作为一种变通方法,您可以简单地在您的不可信配置中将force
更改为add
。只要你的评论不包含嵌入的双空格和三空格,这似乎是正确的行为。(当遇到连续的空白字符时,uncrustify的换行有点古怪。)
编辑:该错误已在master中修复,截至2012-12-04:https://github.com/bengardner/uncrustify/commit/44e0253a
相关文章:
- 2D数组来自文本输入,中间有空格
- 为字符串中每 N 个字符插入空格的函数没有按照我认为的方式工作?
- 如何在C++中读取空格分隔的输入 当我们不知道输入的数量时
- 如何在c++中使用system()来运行包含空格的python脚本
- basic_string的前导/尾部不区分空格的特征
- 移除前面有空格的前2个字符串
- 如何将以逗号和空格分隔的整数读取到 2D 数组中?
- 如何在 C++ 中从文件中读取字符数组(带有一些空格)
- 如何逐行读取文件,每行中的内容都用空格分隔并将其写入新文件中
- 为什么 c++(g++) 不允许模板返回类型和函数名称之间有空格?
- 用于存储由空格分隔的字符串的 C++/C 数据结构
- 在字符串中插入空格
- C ++中的StringStream有助于使用向量从字符串中提取逗号分隔的整数,而不是空格分隔的整数,为什么?
- C++为一串单词添加空格
- 使用另一个字符串从字符串中删除空格
- 我还可以添加什么来按空格或空格正确拆分C++字符串?
- 如何打印不带空格的输入整数?
- 野牛/yacc 解析器在不被空格分隔时跳过 grammer - "unexpected $end"
- C++ "noskipws"没有按预期工作,如何正确允许字符串中的空格?
- 在换行的命令行中,取消//后面的空格的合理性