提问人:Alexey Starinsky 提问时间:3/23/2019 最后编辑:Paweł BylicaAlexey Starinsky 更新时间:3/25/2019 访问量:2901
“if”、“while”、“catch”等后面的空格。使用 clang 格式
Space after 'if', 'while', 'catch' etc.. with clang-format
问:
无法弄清楚该选项在 、 、 等之后添加空格...if
while
catch
目前我的 .clang 格式文件产生这个:
while(true)
{
if(flushedCount == count)
{
break;
}
}
答:
7赞
Paweł Bylica
3/25/2019
#1
控制 、 和其他控制语句后面的空间的配置选项称为 。clang-format
if
while
catch
SpaceBeforeParens
SpaceBeforeParens: ControlStatements
SpaceBeforeParens(帕伦斯空间酒店) (
SpaceBeforeParensOptions
)定义在哪些情况下在左括号前放置空格。
可能的值:
- [...]
SBPO_ControlStatements
(在配置中:)仅在控制语句关键字 () 之后的左括号前加一个空格。ControlStatements
for/if/while...
- [...]
评论
0赞
cassepipe
9/2/2022
也许像我一样,您来到这里是为了知道是否有办法在括号内的控制语句周围添加间距。唉,截至 2022 年 9 月 2 日,使用 clang-format 14 不存在。SpaceAfterParens: ControlStatements
评论