Repository navigation
Fix alignment with extra spaces after the * or &. - #1359
Merged
Merged
Conversation
Aligning variables does not work correctly in the following case: float & c; double & d; This commit fix it. In AlignStack::Add() the threshold check is moved after reducing the space between 'ref' and 'start'.
Collaborator
|
Neat, could you check if # Controls the positioning of the '*' in typedefs. Just try it.
# 0: Align on typedef type, ignore '*'
# 1: The '*' is part of type name: typedef int *pint;
# 2: The '*' is part of the type, but dangling: typedef int *pint;
align_typedef_star_style = 1 # unsigned number
# Controls the positioning of the '&' in typedefs. Just try it.
# 0: Align on typedef type, ignore '&'
# 1: The '&' is part of type name: typedef int &pint;
# 2: The '&' is part of the type, but dangling: typedef int &pint;
align_typedef_amp_style = 1 # unsigned numberis working with this? I am not sure if there is already a test for that. |
Contributor
Author
|
I added more tests for the option align_var_def_thresh. This fix does not affect the align_typedef_xxx so much. Also, there is no align_typedef_thresh option. Therefore, it should be in another fix. |
Collaborator
|
Thanks for the fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligning does not work correctly in variable definitions with extra spaces between '*'/'&' and variable name:
produce:
expected:
Config:
This PR is an option how to fix this issue.