c++ - 阻止铿锵格式断线
问题描述
我想改变下面的行为(左边是它应该的样子,右边是它的结果)
这是我目前的.clang-format
:
---
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'true'
AlignConsecutiveDeclarations: 'true'
AlignTrailingComments: 'true'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'true'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Allman
IndentWidth: '4'
SpaceAfterCStyleCast: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
Standard: Latest
TabWidth: '0'
UseTab: Never
PointerAlignment: Left
ColumnLimit: 0
...
它正确地将函数定义和参数放在同一行,但对于函数调用和 for 循环,例如,它并没有做同样的事情。
解决方案
推荐阅读
- php - 避免在 WooCommerce 函数中出现错误“调用成员函数 get_cart()…”
- python - 无法使用 pip3 安装请求
- c++ - 管理 TCP 服务器内的连接对象的线程安全问题
- c# - 尝试删除具有关系的模型时关联断开异常
- postgresql - 数据库列中 a 物理占用的大小取决于我的字符串大小或列的最大大小?
- python - Coursera 课程 - Python 作业中的数据科学介绍 1
- node.js - Firebase 功能:错误:无法打开写入
- flutter - 如何在 Flutter 中使用 setState() 更新 ModalBottomSheet 的 ParentWidget?
- arrays - 删除 C 数组中的重复项
- html - 如何在链接按下时显示弹出窗口?