Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify ContinuationIndentWidth as 2*IndentWidth #121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tejasvi
Copy link

@tejasvi tejasvi commented Jan 26, 2022

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)

Most styles use ContinuationIndentWidth = 2*IndentWidth (google, llvm, etc). With existing arguments, shiftwidth=4 gives
```cpp
constexpr operator To() const
    noexcept(noexcept(static_cast≺To≻(ːdeclval≺From≻()))) ⇉
    return static_cast≺To≻(val)
```
instead of expected
```cpp
constexpr operator To() const
        noexcept(noexcept(static_cast≺To≻(ːdeclval≺From≻()))) ⇉
    return static_cast≺To≻(val)
```
@rhysd
Copy link
Owner

rhysd commented Feb 3, 2022

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',
            \ }

@tejasvi
Copy link
Author

tejasvi commented Feb 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants