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

indent_align_string should align to first, not last #3086

Closed
mwoehlke-kitware opened this issue Feb 2, 2021 · 1 comment · Fixed by #4288 · May be fixed by #3723
Closed

indent_align_string should align to first, not last #3086

mwoehlke-kitware opened this issue Feb 2, 2021 · 1 comment · Fixed by #4288 · May be fixed by #3723

Comments

@mwoehlke-kitware
Copy link
Collaborator

Consider the following two (similar) code snippets:

void foo(){
        bar(
                "text" TOKEN TOKEN
                "more text");
}

void foo(){
        bar(
                "text" TOKEN "text"
                "more text");
}

It seems that both of these should be unchanged. However, with indent_align_string = true, the second is reformatted as:

void foo(){
        bar(
                "text" TOKEN "text"
                             "more text");
}

It seems that alignment should back up to the first string in a sequence of (STRING, WORD)+ STRING rather than aligning at the last.

(Another possible issue is that the first sequence gets marked STRING, TYPE, WORD when it should probably be STRING, WORD, WORD. Also, why are all string literal arguments apparently being marked with parent type PP_INCLUDE?)

@guy-maurel
Copy link
Contributor

PR #4288 is a bug fix proposal.
Please test it and report.

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