刚开始我发现修改.clang-format
中的 IndentWidth
并不会生效,但是用其他的编辑器例如 vscode 格式化的话却没有问题,而且在 lsp-mode
中使用 lsp-format-buffer
也没报错。
后来打开了 lsp-enable-on-type-formatting
选项,才发现有报错
上图也是直接 clang-format -style=llvm -dump-config > .clang-format
后的结果
稍微用二分法分了下,好像不止一个选项会有报错。
不过用 format-all-mode
不会有这个问题。
如果是bug的话,我也不会报 issue, 来求助坛友了。
环境是 doom emacs 和 emacs 29 up-to-date