vim-clang-format
vim-clang-format copied to clipboard
Specify ContinuationIndentWidth as 2*IndentWidth
trafficstars
Most styles use ContinuationIndentWidth = 2*IndentWidth (google, llvm, etc). With existing arguments, shiftwidth=4 gives
constexpr operator To() const
noexcept(noexcept(static_cast≺To≻(ːdeclval≺From≻()))) ⇉
return static_cast≺To≻(val)
instead of expected
constexpr operator To() const
noexcept(noexcept(static_cast≺To≻(ːdeclval≺From≻()))) ⇉
return static_cast≺To≻(val)
I think it should be set with g:clang_format#style_options rather than setting it always. How about the following configuration?
let g:clang_format#style_options = {
\ 'ContinuationIndentWidth' : '8',
\ }
It would work, but I'd like to propose better defaults and OOTB experience. Currently behavior deviates from the expected indentation for g:clang_format#code_style since it overrides IndentWidth but not ContinuationIndentWidth. Feel free to close this one, I am fine either way.