I want my visibility modifiers (public
, protected
and private
) to be indented by clang-format who currently leaves them at the same level as the class declaration. I've looked for indent
and visibility
on a dump of the default format options but couldn't find anything.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
From the Clang-Format Style Options documentation:
AccessModifierOffset (int) The extra indent or outdent of access modifiers, e.g. public:.
So, add the appropriate entry to your .clang-format
. For example,
AccessModifierOffset: 2