c++ - 如何防止 clang-format 在#define 列表之前添加换行符
问题描述
我正在尝试做的事情:
#define NEOPIXEL_BKGD_COLOR { 255, 255, 255, 0 } // R, G, B, W
什么 clang-format 强加给我:
#define NEOPIXEL_BKGD_COLOR \
{ 255, 255, 255, 0 } // R, G, B, W
如何防止 clang 添加该换行符?
这是我当前的 clang 配置,尽管我已经尝试了几乎所有我知道的选项:
BasedOnStyle: LLVM,
IndentPPDirectives: BeforeHash,
ColumnLimit: 0,
AlignConsecutiveMacros: AcrossEmptyLinesAndComments,
AlignTrailingComments: true,
SpacesBeforeTrailingComments: 2,
IndentWidth: 2,
TabWidth: 2,
MaxEmptyLinesToKeep: 1,
PointerAlignment: Right,
SortIncludes: false,
AlignConsecutiveAssignments: AcrossComments,
Cpp11BracedListStyle: true
解决方案
推荐阅读
- python - 使用 Selenium Python 下载嵌入式 SVG?
- python - 过滤具有最后修改时间的文件
- shell - 我输入了一个 shellscript 程序来生成一个数字表。我正在使用onworks(在线操作系统平台)
- android - Android 中的 Firebase 通知 (Kotlin)
- centos - 构建 HPL 的问题
- neural-network - 为什么 GAN 需要潜在空间噪声作为输入?
- python - 在TensorFlow中同时沿多个轴的Argmax
- reactjs - 类型错误:document.getElementById(...) 为空;使用 axios 做出反应
- deep-learning - Vnet 深度学习 3D 体积图像分割。如何处理大尺寸和不同尺寸的图像?
- database - 使用golang在postgres中从csv批量插入而不使用for循环